[5382] in java-interest

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

Label.CENTER

daemon@ATHENA.MIT.EDU (Chris Gokey)
Wed Feb 7 09:46:06 1996

Date: Wed, 7 Feb 1996 08:25:29 -0500
From: ra104@cosc.bsu.umd.edu (Chris Gokey)
To: java-interest@java.sun.com
Cc: ra104@cosc.bsu.umd.edu, ra103@cosc.bsu.umd.edu, ra203@cosc.bsu.umd.edu,
        ra305@cosc.bsu.umd.edu

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

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