[4917] in java-interest
How To Display an Image in a Java Application ?
daemon@ATHENA.MIT.EDU (Amit Gupta, Calcutta, India)
Mon Jan 22 15:48:22 1996
Date: Mon, 22 Jan 1996 18:49:32 +0000 (GMT)
From: "Amit Gupta, Calcutta, India" <amit@giascl01.vsnl.net.in>
To: java-interest@java.sun.com
Cc: trk@bilbo.wipsys.soft.net
Hi everybody!
I was trying to display an Image from a Java Application.But I could not find the much
needed methods.So I tried to run an animation applet(coming with demo) from the application.But in doing so I am getting these errors:
java.lang.NullPointerException
at java.applet.Applet.getAppletContext(Applet.java:83)
at java.applet.Applet.getImage(Applet.java:120)
at Animator.fetchImages(Animator.java:270)
at Animator.run(Animator.java:590)
at java.lang.Thread.run(Thread.java:289)
run
{
...
URL badURL = fetchImages(images); //line 590
...
}
fetchImages
{
...
Image im = getImage(url); //line 270
...
}
I have set url=new URL(file:///C:/javatest/animation/images/image.gif );
What I could gather is that AppletContext remains null and is not being initialized.
Can someone please help me!
I need to know exactly how to display an image on a standalone application.It is
quite possible that there is already support for displaying an Image which I might have overlooked.If anyone finds anything that might be of help ,please let me know.Sample code fragments may be helpful .
Regards.
Anujit Sarkar
Mega Designs
SDF Bldg.
Salt Lake Electronics Complex
Calcutta,India
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com