This is the mail archive of the mailing list for the Kawa project. See the Kawa home page for more information.

[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: return types of Java methods

At 03:27 PM 3/3/99 -0500, Aleksandar Bakic wrote:
>> The problem in your example is with #!null - which is not an object.
>Hm... I've searched DejaNews but couldn't find out why java.awt.Font's
>getFont(<String>) returns #!null when passed "Helvetica" (which is
>used in some book examples). I tried replacing primitive-static-method
>by primitive-constructor but got another error (no such constructor;
>although there should be one with three parameters). Sorry if this is
>too much to ask, but I'd appreciate any hints...

That is what Font.getFont(String) does when it doesn't find a font with a
matching property string.

    public static Font getFont(String nm) {
	return getFont(nm, null);

See the docs for java.awt.Font.getFont(String, Font);

I don't have any specific information on why that is failing for you.  I
can only suppose a typographic error or something is fouled up in your Java

James P. White                 Netscape DevEdge Champion for IFC 
IFC Exchange   *   Insanely great Java   * Pagesmiths' home is