[5332] in java-interest

home help back first fref pref prev next nref lref last post

RE: How do I specify rows/columns for GridBagLayout?

daemon@ATHENA.MIT.EDU (Groshe)
Tue Feb 6 07:12:28 1996

From: Groshe <gnicaj@iu.net>
To: "'java-interest@java.sun.com'" <java-interest@java.sun.com>,
        "'java@java.sun.com'" <java@java.sun.com>,
        "'John D. Kane'" <john@insightnews.com>, "'jug@jug.org'" <jug@jug.org>
Date: Thu, 1 Feb 1996 19:55:54 -0500

I too have experience the same frustration with GridBagLayout.
So I am staying away from it and just placing elements at specific coordinates.

But this of course isn't very flexible.

Groshe
----------
From: 	John D. Kane[SMTP:john@insightnews.com]
Sent: 	Wednesday, January 31, 1996 8:34 PM
To: 	'java@java.sun.com'; 'java-interest@java.sun.com'; 'jug@jug.org'
Subject: 	How do I specify rows/columns for GridBagLayout?


It appears to me that when I use GridBagLayout and GridBagConstraints, 
whatever I'm using them on -- whether it be a panel, window, frame, etc, -- 
the grid size is always 1x1.

The GridBagConstraints gridx and gridy variables and gridwidth and 
gridheight variables exist to place components on the grid. I want to be 
able to use them.

How can I specify the number of columns and rows in the grid? If I use:
   setLayout(new GridLayout(10, 10));
then I can't use GridBagConstraints and GridBagLayout (I can but they don't 
work), so I think this is not the answer I'm looking for.

So I end up using such things as RELATIVE, BOTH, etc. rather than specific 
grid positions. These work alright but they're not specific enough. Of 
course, I don't want to tie the components to specific coordinates because I 
want them to be flexible when the window changes size.

Any help would be much appreciated.

John


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post