• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pesky Group Layout

 
Lance Cash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all. I'm new here, so be nice. Anywho...I'm having a bit of trouble using the GroupLayout for my panel. My requirements for this little GUI that I'm writing involve dynamic label-field values. Thus, I have written some generic methods to handle the layout that take a LinkedHashMap of label-value pairs to build the panel. It's working great...with one exception: resizing larger works beautifully, but when I try to resize smaller, the fields won't resize with the window; they just stay to the last largest size they were. This is obviously unacceptable. Here are my 2 generic methods for building and laying out my panels:



And obviously, the use case is just to pass the aforementioned map:



I've tried adding "glue" from the BoxLayout, but that was unsuccessful. I would greatly appreciate any ideas you guys have. Thanks alot!!! Lance.

P.S. I've attached an image of the fields after being resized larger and then smaller so you could see the behavior. Thanks again for your time.
cutoff fields.JPG
[Thumbnail for cutoff fields.JPG]
Image of cutoff fields
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Use Code Tags.
 
Lance Cash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that. May be a little easier on the eyes now. ;)
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if it solves exactly this problem, but this article describes something very close to what you're doing (and even if it doesn't help in this case, it's still worth checking out).
 
Lance Cash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, this is an alternate approach I could go to if I must...but I'd REALLY just like to get mine working correctly. Thanks for the link, though!
 
Lance Cash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any other takers?...
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lance Cash wrote:Any other takers?...

Sure, MigLayout or GridBagLayout.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!