[4440] in java-interest

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

window bug?

daemon@ATHENA.MIT.EDU (Bindu Wavell (RUFUS))
Wed Dec 27 05:01:59 1995

To: java-interest@java.sun.com
Date: Wed, 27 Dec 1995 01:09:28 -0700
From: Bindu Wavell (RUFUS) <wavell@nag.cs.colorado.edu>


If I use getFont() in a derived class of window, I get null back... Is 
that correct behavior?

The following program compiles just fine, but then breaks at 
fm.getHeight(); because fn and fm are null. 


import java.awt.*
class FooBar extends Window
{
  int height;
  public FooBar()
  {
	super(null);
    Font fn = getFont();
    FontMetrics fm = getFontMetrics(fn);
	height = fm.getHeight();
  }
  public static void main(String args[])
  {
	FooBar foobar = new FooBar();
	System.out.println("Done");
  }
}


TIA, Bindu
-
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