[2398] in java-interest

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

Re: JDK : layout : is something wrong ?: pre-beta ex .

daemon@ATHENA.MIT.EDU (CharlesMBarton/Watson/IBMResearch)
Sat Sep 30 08:50:18 1995

To: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
Cc: dufourd <dufourd@enst.enst.fr>, java-interest <java-interest@java@Sun.COM>
From: Charles M Barton/Watson/IBM Research
  <barton@watson.ibm.com>
Date: 27 Sep 95  7:24:48

>> I cannot get anything deterministic out of the various
>> layoutManagers. Is something wrong, or is it just me ?
>
>I hope it is just you. If you have a particular problem you'll have
>to attached a simple example. Random muttering doesn't help.

I was just trying to ask "open" questions, as opposed to the "closed"
assertion I had made about exceptions. And I do not like to throw a bunch
of code at someone's head and say : sort it out! But you asked... :-)

The following code is a "simplified" version of the applet I am migrating.
All canvas are replaced with labels. This scaled down version, when compiled
and viewed by a DecAlpha machine used as X terminal on a Solaris 5.4
SparcCenter 2000 has the following problem : the huge label between the
start and stop comments disappears (should be in the top middle and right).
Only the right half of a small s can be seen.

In the original applet, when I change all LayoutManagers to FlowLayout,
I do not get a single row of elements either. When I change all
LayoutManagers to null (absolute placement?), everything disappears.
When I change the order of the adds, or the layouts, non-deterministic
changes happen : some elements disappear (even after a repaint!), some
are truncated. For my previous applet, I just tried many relative
placements until one worked (miraculously).

JC
--------------8<------------------
import java.awt.*;
import java.applet.*;

public class h extends Applet {
    Label MT ;

    public void init() {
 setFont( new Font( "Helvetica", Font.PLAIN, 14 ));

 setLayout( new BorderLayout());

 Panel leftTop = new Panel();
 leftTop.setLayout( new BorderLayout());
 leftTop.add( "North", new Label("MOSTransistor"));
 leftTop.add( "South", new Label("vcommands"));

// start
 MT = new Label("mostrans");
 MT.setFont( new Font( "helvetica", Font.BOLD, 48 ));
//stop

 Panel top = new Panel();
 top.setLayout( new BorderLayout());
 top.add( "West", leftTop );
 top.add( "East", MT );
 add( "North", top );

 Panel viewLine = new Panel();
 Panel rightViewLine = new Panel();
 rightViewLine.setLayout( new BorderLayout());
 viewLine.add( "Top", new Label("TopView") );
 viewLine.add( "RVL", rightViewLine );
 rightViewLine.add( "North", new Label("Cut"));
 rightViewLine.add( "Center", new Label("sideview"));
 rightViewLine.add( "South", new Label("topview"));
 add( "Center", viewLine );
    }

}

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

-
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