GridBagLayout column size

I have a stupid question, but hopefully i won't get stupid answers. :-)

Is there anyway we can change the size of the column of a GridBag Layout? I have this Pane layed out using a GridBag. The first column contains an Icon, the next column contains some text. If the text is too sort, both column will be forced to have the same width, it will stretch the size of the column with an Icon in it. How to prevent this? I want size of the the column with an Icon in it, stay the same.

Thank you.

[519 byte] By [walrux] at [2007-9-26 4:30:47]
# 1
Hi thereGoto this link and study the tutorial If Im my memory is correct there should be a section telling you what you can and can not do with theGridBagLayout http://java.sun.com/docs/books/tutorial/index.htmlMarkus
markusbengtsson2 at 2007-6-29 17:43:37 > top of Java-index,Desktop,Core GUI APIs...
# 2

You cannot resize the grids of a GridBagLayout manager. the grids are resized automatically when a component is placed inside it.

I guess you are using the GridLayout manager on your panel. The size of the grids, will be the same for all, the width/height of which is set to the component with the maximum width/height.

Try using the FlowLayout manager instead. Look at the standard API.

Rizwan

rizqureshi at 2007-6-29 17:43:37 > top of Java-index,Desktop,Core GUI APIs...