getGraphics should work. Are you sure that getGraphics returns null. Did you
call getGraphics before adding the canvas3d to the view. I am not sure but
that could also be the problem. Try to find out what exactly is null when
that NullPointerException is thrown.
The ideal place to put this draw code seems to be in postSwap. In paint it
used to flicker.

Rajesh Gupta

----- Original Message -----
From: BENOIT VIGIER <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 21, 1999 5:07 PM
Subject: [java3d] Add text to a Canvas3D using its Graphics


> Hi everybody !
>
> I have created a 3D modeller, and I just want to add the name of
> the views (4), (and also a small axis) on each canvas3D so that the
> user can identify it.
>
> I tried to use the graphic pointer (method getGraphics(), and then
> to do a drawString), but it returns me a null pointer exception (how
> does it manage the stuff, if so...?).
>
> Did anybody try to do this kind of thing... and succeeded ?
>
> Thanks for your advices.
>
> Ben
>
>
>
> -------------------------------------------------
> Benoit VIGIER
> BSc (Hons) Computer Studies Year 3
> North East Wales Institute of Higher Education
> University of Wales Associate College
> E-Mail : [EMAIL PROTECTED]
> -------------------------------------------------
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to