Hey all,
I have a gui that is set up using a GridBagLayout. The content pane has
nine panels and a JLabel added to it. Each of the nine panels has one
JList, two JButtons, and a JLabel, set up in border layout.
Here's the problem. Everything works fine until I change the text of the
label. Once I do that, the whole display becomes corrupted. The JButtons
and JLabels disappear, and the JLists empty. The whole display collapses to
a much smaller size in the center of the display.
In other forums, I have received advice about making sure that the changing
of the text is not in the main thread. It isn't, and even when I put it in
another (new) thread, it did not work. Any ideas?
James
Andrew Thompson - 14 Jan 2005 07:49 GMT
> I have a gui that is set up using a GridBagLayout. The content pane has
> nine panels and a JLabel added to it. Each of the nine panels has one
> JList, two JButtons, and a JLabel, set up in border layout.
>
> Here's the problem. Everything works fine until I change the text of the
> label.
Recent posts suggest that GBL reacts poorly when a component
cannot be assigned it's minimum size. If you want to fix
this GBL, that is where I recommend looking. OTOH, I more stringly
recommend that you dump GBL altogether and use another layout,
or a combination of layours.
HTH

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
The Grim Reaper - 16 Jan 2005 10:54 GMT
> > I have a gui that is set up using a GridBagLayout. The content pane has
> > nine panels and a JLabel added to it. Each of the nine panels has one
[quoted text clipped - 10 lines]
>
> HTH
I agree. I would recommend TableLayout instead of GBL. It can be downloaded
from the sun web site:
http://java.sun.com/products/jfc/tsc/articles/tablelayout/ and is much more
straighforward to use.