I simply put the class file and the html file in the same directory. And I call the applet with this:
<p align="center">
<applet code="/ShowImage.class" width="200" height="200">
</applet>
</p>
Obviously this doesn't work. What is the most convenient way to setup local development?
edit:
My applet code:
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
/**
*
* @author PCKhoi
*/
public class ShowImage extends Applet {
private BufferedImage img;
public void init() {
try {
URL url = new URL(getCodeBase(), "what_I_think.jpg");
img = ImageIO.read(url);
} catch (IOException e) {
}
}
public void paint(Graphics g){
g.drawImage(img,20,20, null);
}
}