Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

layout managers

 
Shane McKenzie
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

question about using FlowLayout. I read that it is supposed to go left to right, top to bottom, adding components lower down as a "line" (for lack of a better word) became full. however, I've been trying it out, and i cannot seem to get it to drop down. am I missing soemthing really simple here? any help'd certainly be valued!

thanks,

shane
 
Joe Ess
Bartender
Posts: 9339
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code will do it:

Layout managers require some experementation in order to get the layout just right. They can have side effects, like the preferred width of the frame in the above example is the sum of the preferred sizes of all the contents (uncomment pack() and witness the result). If you REALLY want two rows of buttons, you'd best make two rows of buttons using a different layout manager. In the above example you can resize the Frame and get anywhere from 1 to 5 different rows.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic