[2271] in java-interest

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

How to layout Panel items vertically in pre-Beta?

daemon@ATHENA.MIT.EDU (Suresh Srinivasan)
Wed Sep 27 16:37:05 1995

Date: Wed, 27 Sep 1995 14:24:57 -0400
From: suresh@thomtech.com (Suresh Srinivasan)
To: java-interest@java.sun.com

Hi all,

I've been playing with the layout managers (BorderLayout,
GridLayout, etc). Is there an easy way to lay out items vertically
with the existing managers?

For example, in DrawTest.java, I'd like the color palette to laid
out vertically as an "East" component of the applet, yet be
centered vertically.

I first removed the Choice item (Lines/Points) for simplicity.
I tried using GridLayout(6, 1) for the DrawControls class,
but that of course makes the checkboxes 1/6th the height of
the applet.

Then I tried changing the init() method of DrawTest to:

    public void init() {
	setLayout(new BorderLayout());
	DrawPanel dp = new DrawPanel();
	add("Center", dp);
	DrawControls dc = new DrawControls(dp);
	Panel p = new Panel();
	p.setLayout(new BorderLayout());
	p.add("East", dc);
	add("East", p);
    }

In other words I create an "East" panel with BorderLayout and add
the controls as *its* "East" item.  Now I don't even see the palette.

I apologize if this is something trivial, but would appreciate some help.

Thanks,

--Suresh
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

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