• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple JFrame formatting...

 
Adam Ellsworth
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic