Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Border Layout quesion  RSS feed

 
Adam Blais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using BorderLayout to put a row of JButtons on the south edge of the window. It ended up stretching out the last button I added at the bottom. How do I add a row of buttons?
[ March 18, 2005: Message edited by: Adam Blais ]
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Adam -

I generally would add the buttons to another container (JPanel) then add the container to the content pane. You can set the preferred size too.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT...
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adam,

You may have a look at this Border Layout example UsingBorderLayout_withFlowLayout.java.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!