Problems with GridBagLayout

Hello all,

I have to implement a JPanel with several input items and use the GridBagLayout manager. My problem is, that the size of some text items won't be set to the preferred size (they are only 1px width as long as I don't set the attribute "fill" to another value than "none").

The Grid looks like this:

c1 c2 c3c4

r1label1textitem1label2textitem2

r2label3textarea1 textarea1 textarea1-> span 3

r3label4textarea2 textarea2 textarea2-> span 3

r4label5textitem3 -> span 1

....

All constraints for the used item are the same except gridwidth, gridx and gridy. I already tried to set the widthx property to several values but that didn't work either.

Has anybody any ideas?

Thanks for your efforts and best regards,

Jens

[815 byte] By [JeSchua] at [2007-11-27 5:36:02]
# 1

[url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use GridBagLayout[/url]

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.

camickra at 2007-7-12 15:06:02 > top of Java-index,Desktop,Core GUI APIs...