File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

buttons...flow layout?

 
Brandi Love
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to format some buttons in a window so that two of them appear on lines by themselves, while others are lined up at the top. Here is how I have them lain out in my program I'm working on now...

I want to format it so that the above average and property buttons aren't lined up together, so that they are on seperate lines. Can this be done?
 
A. Wolf
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what I would do if I had to do what you are doing, I would create a new GridLayout with 4 rows and 1 column, and then create 4 panels using flowlayout, add the first 3 buttons to the first panel, the next 3 buttons to the second panel, then the above average button to the third panel, and the poverty button to the last panel, and then add the four panels in order to the frame or window or whatever you're using.
for some reason I keep thinking you're really looking for a MenuBar?
 
Brandi Love
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whats a menu bar?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brandi Love:
whats a menu bar?

I assume you are using Internet Explorer, Mozilla, Netscape, or some varient there of to browse the web. Or that maybe you have used a program like MS Word, Excel, anyway....
A menu bar is that bar at the top of those applications that are:
File Edit View Tools Help, etc
You click on them and a drop down appears with other menu choices.
SWING has a component called JMenuBar which is exactly that. A bar with Menu Items on it, just like in other Windows/Linux applications.
Here is a good tutorial on JMenuBars in SWING.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic