• Post Reply Bookmark Topic Watch Topic
  • New Topic

changing sizes in GridLayout

 
Pete Davies
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi good people,
In my GUI I am using a GridLayout to stack some JButtons. Is there any way of changing the size of these buttons, specifically their width? At the moment, the GridLayout seems to override any attempts to setSize them.
Cheers.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try placing them on a panel. Then putting the panel in the grid.
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GridLayout always gives everything equal size, no matter what size you specify. It's useful in some contexts, but it sounds like you would be better off with a BoxLayout or a FlowLayout.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!