This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple JFrame formatting...  RSS feed

 
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)

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!