[5398] in java-interest

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

Re: Label.CENTER

daemon@ATHENA.MIT.EDU (Cyberia9 (London))
Wed Feb 7 18:05:38 1996

Date: Wed, 7 Feb 1996 21:15:29 GMT
To: ra104@cosc.bsu.umd.edu (Chris Gokey), java-interest@java.sun.com
From: cybercafe@easynet.co.uk (Cyberia9 (London))
Cc: ra104@cosc.bsu.umd.edu, ra103@cosc.bsu.umd.edu, ra203@cosc.bsu.umd.edu,
        ra305@cosc.bsu.umd.edu

At 08:25 07/02/96 -0500, Chris Gokey wrote:
>I am developing a application that must run on both Solaris 2.4 and
>on Windows 95.  I am using the jdk that came with hooked on java.  
>I think this is an up to date version????   This code centers 
>the labels fine on Solaris, but it ignores Label.CENTER on
>Windows 95.  Is their a bug on Windows 95 version; do I have the
>most up to date copy??  
>
>Here's a sample of what I want to do (it should compile with
>no bugs.)
>------------------------------------------------------
>import java.awt.*;
> 
>class myFrame1 extends Frame {
>        public myFrame1() {
>        	setLayout(new GridLayout(2,0));
>        	add(new Label("Line1",Label.CENTER));
>        	add(new Label("Line2",Label.CENTER));
>        }
>    	public static void main(String args[]) {
>            myFrame1 x = new myFrame1();
>	    	x.pack();
>            x.show();
>	}
>}
>--------------------------------------------------------
>I have figured out a way to get around this, and its by
>embedding a panel in each row....   But this doesn't seem
>to efficient.  Any other ideas?  Here my way around it (again
>it should compile with no bugs.)
>---------------------------------------------------------
>import java.awt.*;
>
>class myFrame2 extends Frame {
>        public myFrame2() {
>            Panel p;
>        	setLayout(new GridLayout(2,0));
>            p = new Panel();
>            p.add(new Label("Line1",Label.CENTER));
>            add(p);
>
>            p = new Panel();
>            p.add(new Label("Line2",Label.CENTER));
>            add(p);
>        }
>    	public static void main(String args[]) {
>            myFrame2 x = new myFrame2();
>	    	x.pack();
>            x.show();
>        }
>}
>
>Thanks,
>Chris Gokey
>ra104@cosc.bsu.umd.edu
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>
>
Cafe Cyberia!!!!  
London ENGLAND

-
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