• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with selecting a layout

 
A Kal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are n button-labels given to me.
I need to create and display buttons in the following format in a panel dynamically:
-----------------------------------
Button1 Button3 Button5 Button7 ...
Button2 Button4 Button6 Button8 ...
-----------------------------------
Any suggestions on what layout I should use ? FlowLayout allows me to achieve this in a single row, but I want them to appear in two rows.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Visual Guide to Layout Managers in the Java Tutorial.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sandeep" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look up GridLayout...that'll help you get started...
 
A Kal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David ! GridLayout solved my problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!