Results 1 to 2 of 2
Like Tree2Likes
  • 2 Post By KevinWorkman

Thread: AWT GUI Control positioning

  1. #1
    Blondedude092 is offline Member
    Join Date
    Sep 2012
    Posts
    16
    Rep Power
    0

    Default 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.
    AWT GUI Control positioning-cam00079.jpg
    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.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,889
    Rep Power
    8

    Default 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)
    DarrylBurke and quad64bit like this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Help in positioning and running to the web
    By jairoh_ in forum Java Applets
    Replies: 3
    Last Post: 10-10-2012, 07:36 PM
  2. Vertical box and positioning
    By aborgeld in forum New To Java
    Replies: 9
    Last Post: 04-01-2011, 07:33 PM
  3. Positioning using setBounds
    By thayalan in forum AWT / Swing
    Replies: 4
    Last Post: 04-28-2009, 01:59 AM
  4. panel positioning
    By shwein in forum New To Java
    Replies: 4
    Last Post: 09-09-2008, 05:15 PM
  5. control app width based on certain control
    By thebillybobjr in forum SWT / JFace
    Replies: 0
    Last Post: 05-15-2008, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •