S
sacha.vdk
Hi,
I'm trying to make a little java application for my website, but I have
to load images. The compiling of the code gives no errors, but when I
run it, it says "Applet not initialized". I know wich row the message
causes, but I don't know how to solve it.
Here's the code:
-------------------------------------------------------------------------------------------------------------
import java.awt.*;
import java.applet.*;
import java.awt.Image.*;
public class App extends Applet {
DeskTop desktop;
public void init() {
desktop = new DeskTop( );
}
public void paint(Graphics g) {
desktop.paint( g );
}
}
class DeskTop extends App {
private String desktopimagename;
private Image desktopimage;
public DeskTop( ) {
desktopimagename = "bg_Tiger.jpg";
desktopimage = super.getImage(super.getDocumentBase(), "img/" +
desktopimagename);
}
public void paint( Graphics g ) {
g.drawImage( desktopimage, 0, 0, super.WIDTH, super.HEIGHT, this );
}
}
-------------------------------------------------------------------------------------------------------------
The code wich causes the message is the 23rd row:
desktopimage = super.getImage(super.getDocumentBase(), "img/" +
desktopimagename);
Does anybody know something that can solve this?
Thanks in advance...
I'm trying to make a little java application for my website, but I have
to load images. The compiling of the code gives no errors, but when I
run it, it says "Applet not initialized". I know wich row the message
causes, but I don't know how to solve it.
Here's the code:
-------------------------------------------------------------------------------------------------------------
import java.awt.*;
import java.applet.*;
import java.awt.Image.*;
public class App extends Applet {
DeskTop desktop;
public void init() {
desktop = new DeskTop( );
}
public void paint(Graphics g) {
desktop.paint( g );
}
}
class DeskTop extends App {
private String desktopimagename;
private Image desktopimage;
public DeskTop( ) {
desktopimagename = "bg_Tiger.jpg";
desktopimage = super.getImage(super.getDocumentBase(), "img/" +
desktopimagename);
}
public void paint( Graphics g ) {
g.drawImage( desktopimage, 0, 0, super.WIDTH, super.HEIGHT, this );
}
}
-------------------------------------------------------------------------------------------------------------
The code wich causes the message is the 23rd row:
desktopimage = super.getImage(super.getDocumentBase(), "img/" +
desktopimagename);
Does anybody know something that can solve this?
Thanks in advance...