wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Simple JFrame formatting... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Simple JFrame formatting..." Watch "Simple JFrame formatting..." New topic
Author

Simple JFrame formatting...

Adam Ellsworth
Greenhorn

Joined: Sep 25, 2004
Posts: 21
Im making a simple program and have probably a fairly simple question. My problem is, I want one of my JButtons/TextArea above my legendArea but it keeps coming up to the left of it. Is there any command to create a break of somesort? Any help would be appreciated Thanks.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Are you adding them to a JPanel?
If so, the default layout is a FlowLayout, so they will go from left to right (depending on widths).
Change the layout of the panel to BorderLayout, then add to NORTH and CENTER

something like this (aircode - expect a typo or two)

 
jQuery in Action, 2nd edition
 
subject: Simple JFrame formatting...