• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

buttons...flow layout?

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whats a menu bar?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic