1 Attachment(s)
AWT GUI Control positioning
Hi, I have been trying to go by the programming book and I am trying to position controls as shown in the Figure 5-50a. I have been going at this for more than 8 hours and I still don't get the results as in the picture. I have no idea how it's done, the book explains things way too poorly and is 7 years outdated.
Attachment 4173
I know how to make all the controls I just have no idea how to use any of the layout controls properly enough to make it look as above.
Re: AWT GUI Control positioning
Use a Layout Manager. More specifically, use nested Layouts- one JPanel with one Layout that holds other JPanels with other Layouts that ultimately hold JButtons.
Break the displays into sections- can you make a single row of buttons? Then can you stack rows of buttons into columns?
Recommended reading: A Visual Guide to Layout Managers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)