Problems with grid layout.

Hi,

I am trying to make a GUI with the GUIDesigner but I find the Layout options
very restrictive. In the attached image I have a column of JComboBox
components and a column of JButton components. I want the buttons to be
right next to the comboboxes but when I apply one of the GridLayout options
the components are automatically stretched to fit the panel. How can I stop
this happening so that components can be directly next to eachother despite
the width of the panel they sit in?

Thanks
Scott





Attachment(s):
etetgui.JPG
4 comments

The same effect is seen here with a column of JButtons. I want them to all
be aligned to the top of the panel they sit in but when the Frame is
stretched the Buttons all separate out - due the GridLayout forced upon them
in the GUIDesigner. Is it possible to set something that allows the buttons
to appear in the same 'cell' when applying a layout and aligning them all
north so they appear one directly under the other from the top of the panel
downwards?

"Scott Curtis" <scurtis@smart421.com> wrote in message
news:cj16fh$u24$1@is.intellij.net...

Hi,

>

I am trying to make a GUI with the GUIDesigner but I find the Layout

options

very restrictive. In the attached image I have a column of JComboBox
components and a column of JButton components. I want the buttons to be
right next to the comboboxes but when I apply one of the GridLayout

options

the components are automatically stretched to fit the panel. How can I

stop

this happening so that components can be directly next to eachother

despite

the width of the panel they sit in?

>

Thanks
Scott

>
>
>





Attachment(s):
etetgui.JPG
0

Scott Curtis wrote:

Use vertical/horizontal spacers to fill to free space that occurs when
resizing panel.

--
Maxim Shafirov
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Did u notice the horizantol/vertical spacer, they are used to occupy extra spaces, that is, when maximized, push all other components away.

0

Thanks Maxim and tc master. I hadn't realised the purpose of the spacers
until now. They have solved my issue. I now have lovely compact GUI forms!

- scott

"tc master" <no_mail@jetbrains.com> wrote in message
news:4500649.1096276306430.JavaMail.itn@is.intellij.net...

Did u notice the horizantol/vertical spacer, they are used to occupy extra

spaces, that is, when maximized, push all other components away.


0

Please sign in to leave a comment.