This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Is it possible to load data from a file held in one of the jar files in the ARCHIVE parameter? Basically, I've got a couple of property files that I'd love the applet to read when it gets initialised. Can anyone help?
Joined: Aug 11, 2000
Oh I forgot, the applet must be able to run offline too.
Where you would replace ClassName with the real name of your class, and image.gif with the real name of the image you are loading ( along with it's path in the JAR file if applicable ). This will work both on and offline. HTH, -Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Okay... Ummm... could you say what error it is giving in Netscape...
Joined: May 29, 2000
It works fine with URL url1 = ClassName.class.getResource("loginpage_image.jpg"); but on the second line it gives the following error: line : panelImage=Toolkit.getDefaultToolkit().getImage(url1); error : java.lang.NullPointerException at sun.awt.SunToolkit.getImageFromHash(Compiled Code) at sun.awt.SunToolkit.getImage(Compiled Code) at ClientMain.images(Compiled Code) at ClientMain.init(Compiled Code) * at netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compiled Code) at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code) at java.awt.EventDispatchThread.run(Compiled Code) at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)