public class Test extends JApplet {
public void init () {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createGUI();
}
});
}
public void createGUI() {
getContentPane().add(new GUIThing());
}
}
public class GUIThing extends JPanel {
BufferedImage image;
public GUIThing() {
try {
image=ImageIO.read(new File("gladiator.gif"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void paintComponent(Graphics g) {
g.drawString("WTF", 20, 20);
g.drawImage(image,100,100,100, 100, null);
}
}
<applet code="test.Test"
archive="test.jar"
width = 1000,
height = 1000 >
gladiator.gif is put in the same directory as the HTML file, yet it dont get drawn.
ive tried not including gladiator.gif, and instead of writing the string Couldnt!!! it shows a blank white page...
this is the gladiator if any1 wants to give it a shot:
When i delete the drawImage related lines it does show the WT string, so i guess its just something weird with the image drawing, what could it be?