Copyright © 2015 – Curt Hill Window Builder Again Some more features.
-
Upload
valentine-joseph -
Category
Documents
-
view
219 -
download
0
description
Transcript of Copyright © 2015 – Curt Hill Window Builder Again Some more features.
![Page 1: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/1.jpg)
Copyright © 2015 – Curt Hill
Window Builder Again
Some more features
![Page 2: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/2.jpg)
Introduction• A few more features of Windows
Builder plugin• Changing variables
Copyright © 2015 – Curt Hill
![Page 3: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/3.jpg)
Variables• Windows Builder is like a large
number of other GUI builders• It generates poor names for things
– These are only the component names• If the component is not referenced in
code, we do not care– Labels and buttons are often not
referenced in code• Fortunately we may do something
about itCopyright © 2015 – Curt Hill
![Page 4: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/4.jpg)
Variable Names• It is always possible to have Eclipse
do a replace all– This might confuse Windows Builder but
a reparse is possible• The better way is to use the property
inspector to change the name• The field is Variable
Copyright © 2015 – Curt Hill
![Page 5: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/5.jpg)
Variable Field
Copyright © 2015 – Curt Hill
![Page 6: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/6.jpg)
JTextField size• The contents of a JTextField does not
affect its size like a label or button• Instead it has a columns property in
the property inspector• It also may be set with the
setColumns method in the code
Copyright © 2015 – Curt Hill
![Page 7: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/7.jpg)
About Box• The about button can be
accomplished in a number of ways• Here is one:
– Create a JDialog that is a second file• We add a new file to the project just
like we did before• Instead of a Windows Application
(which is a JFrame we use a JDialog• Then we have to fill in the JDialog and
show it from the main windowCopyright © 2015 – Curt Hill
![Page 8: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/8.jpg)
Adding JDialog
Copyright © 2015 – Curt Hill
![Page 9: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/9.jpg)
About Box Again• This is a little more complicated than I
would like• Here is the easier alternative• On the web site there is a pre-made
About dialog– It is HTML to facilitate copying
• Place this in your file– At the very end – after the last brace
• In the comment there is the mechanism for calling it
Copyright © 2015 – Curt Hill
![Page 10: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/10.jpg)
Web Page
Copyright © 2015 – Curt Hill
![Page 11: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/11.jpg)
Copy All of This
Copyright © 2015 – Curt Hill
![Page 12: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/12.jpg)
Finally• The Event handler just copies in the
call which is in comments:MyAbout a = new MyAbout(null, false, "The program purpose", "Your name", "year");
• Then modifies it:MyAbout a = new MyAbout(null, false, “Convert years to seconds” “Curt Hill", “2015");
Copyright © 2015 – Curt Hill
![Page 13: Copyright © 2015 – Curt Hill Window Builder Again Some more features.](https://reader030.fdocuments.in/reader030/viewer/2022020216/5a4d1be17f8b9ab0599dfb13/html5/thumbnails/13.jpg)
Conclusion• Of course, there is plenty more to
know• However, we will next do a demo
concerning the line drawing and clean up
• All using Windows Builder
Copyright © 2015 – Curt Hill