• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Changing properties of gridbaglayout

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great. thanks
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic