image on applet/stand-alone program

G

Guest

I have create my program to run as Applet and Stand-Alone too.

My problem is that, 'Image' created from 'Image getImage(URL url)'
works perfect in Applet but don't work in Stand-Alone program
 
G

Guest

I have create my program to run as Applet and Stand-Alone too.
My problem is that, 'Image' created from 'Image getImage(URL url)'
works perfect in Applet but don't work in Stand-Alone program

I add the applet into a 'Frame' created in 'main()'

The problem occurs as an Exception when I run code:
--------
Image ab = myApplet.getImage(new URL(myApplet.getCodeBase() + a));
--------
I have a 'NullPointerException' in 'getCodeBase()'

What is the problem?
What I can do?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top