17.10. Exercises
You can download the source code for the examples in the book and the solutions to the following exercises from http://www.wrox.com.
Create an application with a square window in the center of the screen that is half the height of the screen by deriving your own window class from JFrame.
Add six buttons to the application in the previous example in a vertical column on the left side of the application window.
Add a menu bar containing the items File, Edit, Window, and Help.
Add a drop-down menu for Edit containing two groups of items of your own choice with a separator between them.
Add another item to the Edit drop-down menu, which itself has a drop-down menu, and provide accelerators for the items in the menu.
Here's an exercise to tickle the brain cells—use a SpringLayout to obtain the button arrangement shown in Figure 17-48 in an application window.
Figure 17.48. Figure 17-48
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access