Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GridBagLayout squishes components on resize  RSS feed

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys :

Im using GridBagLayout to layout 5 components. Im not trying
to do anything fancy...
All the components being added below are scrollpanes
with Jtables inside. When I have a maximized window,
the layout is fine, but my problem is that if I resize the window, all the
components get squished together in a really small area
in the center of the screen... Any ideas ?

 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try adding (to each of your constraints)

[constraints].weightx = .5;
[constraints].weighty = .5;
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!