[2038] in java-interest
Re: is *anyone* doing beta1 code?
daemon@ATHENA.MIT.EDU (Jim Graham)
Fri Sep 22 07:16:02 1995
Date: Thu, 21 Sep 1995 11:59:53 -0700
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
To: java-interest@java.Eng.Sun.COM, scott@santafe.edu
> I am running into a problem where I get a "null" in return for a
> getFontMetrics call. The (lousy) docs for getFontMetrics say it will
> return null if the component is not on the screen, but this doesn't
> answer why the call seems to work everywhere else other than a
> constructor.
A Component must be visible on a screen someplace so that we know which
device to get the font metrics from. You aren't actually instantiated
on a screen anywhere until you have a "peer" object which is a specific
instance of that GUI object on a particular device. Peer objects are
created by addNotify() which is called when the "pack()" or "show()"
method on a window or frame is called.
...jim
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com