GridBagLayout

B

Brian

Hi

I'm trying to create a GUI using GridBagLayout.

I have two separate JPanels where i need to place items in the same
place in each panel.

Is it possible to use at GridBagLayout with a fixed / predifined no.
of colums - and all of them with the same width?

/Brian
 
K

Knute Johnson

Brian said:
Hi

I'm trying to create a GUI using GridBagLayout.

I have two separate JPanels where i need to place items in the same
place in each panel.

Is it possible to use at GridBagLayout with a fixed / predifined no.
of colums - and all of them with the same width?

/Brian

Maybe. GBL is very dependent on the preferred sizes of the components.
So if they were all the same size or you make them all the same size,
then yes probably. Also with GBL you can set the weights and fill to
allow the components to expand to the available space in the layout.

I wrote a GBL simulator if you want to try setting up a layout,

http://rabbitbrush.frazmtn.com/gridbagtester.html

If you try it, I would appreciate any feedback.
 
R

RedGrittyBrick

Brian said:
Hi

I'm trying to create a GUI using GridBagLayout.

I have two separate JPanels where i need to place items in the same
place in each panel.

Is it possible to use at GridBagLayout with a fixed / predifined no.
of colums - and all of them with the same width?

That sounds more like GridLayout than GridBagLayout.
 
A

Alex.From.Ohio.Java

Maybe. GBL is very dependent on the preferred sizes of the components.
So if they were all the same size or you make them all the same size,
then yes probably. Also with GBL you can set the weights and fill to
allow the components to expand to the available space in the layout.

I wrote a GBL simulator if you want to try setting up a layout,

http://rabbitbrush.frazmtn.com/gridbagtester.html

If you try it, I would appreciate any feedback.

I tried it - really awesome.

The only suggestion is to create function to export created layout in
Java source format. It will really help developers to visually crate
layout and then use it.

Nice job!

Alex.
http://www.myjavaserver.com/~alexfromohio/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top