• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing properties of gridbaglayout

 
Noam Tenne
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone

I was wondering if anyone could help me with this one.
Me and my team use JbuilderX for our development in Java, and I am currently working on a panel which is designed with GridBagLayout, and i have a jScrollPane component which at default has no fill, but with a press of some button, that has to change (the fill).
I was wondering if that is possible in any way, and if it is, how is it done?
I add my scrollpane with this code:

this.getContentPane().add(jScrollPane1,
new GridBagConstraints(5,2,1,2,1.0,1.0,
GridBagConstraints.SOUTH,
GridBagConstraints.NONE,
 
Brian Nahas
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the scrollpane from the container, re-add it with the different constraints, then call revalidate() on the container.

Sounds like you're getting by with GridBadLayout okay, but I'd suggest looking into ZoneLayout (http://www.zonelayout.com), FormLayout, or TableLayout.
 
Noam Tenne
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great. thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!