my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes Understanding box layouts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Understanding box layouts?" Watch "Understanding box layouts?" New topic
Author

Understanding box layouts?

John Corkrend
Ranch Hand

Joined: Oct 27, 2012
Posts: 51

I've recently tried to use the box layout and I couldn't get it to work quite properly.

When attempting to implement the box layout, I couldn't understand this bit of code. What exactly is the container, my window, a JPanel. And then what is int. Those were the first two things I ran in to.



Here is the basic code of fake program, but the way I have the code organized is the same way I would in a real program.


Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2154
    
    7
How to Use Box Layout
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171
    
    8

John Corkrend wrote:I've recently tried to use the box layout and I couldn't get it to work quite properly.

Its always a good idea to keep the API docs handy. The Java API has excellent comments. Many times it also links to the "How to use xxx" articles like the one Rob posted.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
Consider Paul's rocket mass heater.
 
subject: Understanding box layouts?
 
Similar Threads
Very Very New
Getting text from JTextField/JComboBox?
Visibility help?
Help with actionlisteners on a button.
JAVA /JDBC/GUI