Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Pesky Group Layout

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 22394
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Use Code Tags.
 
Lance Cash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry about that. May be a little easier on the eyes now. ;)
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any other takers?...
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lance Cash wrote:Any other takers?...


Sure, MigLayout or GridBagLayout.
 
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic