I'm trying to use an image that I created in photoshop in a applet. Every time I try to load the image it doesn't show up, but if I use an image from the internet it works fine. I've tried using both png and jpg neither work.
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
public class Test extends Applet{
final int WIDTH = 1000, HEIGHT = 400, MIN = 1;
private Image img;
public void init() {
img = getImage(getDocumentBase(), "image.jpg");
setSize(WIDTH, HEIGHT);
}
public void paint(Graphics g) {
g.drawImage(img, 20, 20, null);
}
}