maybe someone here can help me. I keep getting an instantiation error (runtime) in my applet code. I'm trying to get an applet to display an image wherever I click the mouse. here's the code:
//< applet code="AppletApp.class" width=200 height=300>< /applet>
import java.awt.*; //<-- added code
import java.applet.*; //<-- added code
import java.awt.event.*; //<-- added code
abstract class AppletApp extends Applet implements MouseListener{
private Image duke;
private int xPos,yPos;
public void init() {
duke = getImage(getDocumentBase(),"duke.gif");
addMouseListener(this);
}
public void paint(Graphics g) {
setBackground(Color.white);
g.drawImage(duke, xPos, yPos, this);
}
public void mousePressed(MouseEvent e) {
xPos = e.getX();
yPos = e.getY();
repaint();
}
}
thanks to anyone who can help
Dave
[This message has been edited by Jim Yingst (edited July 07, 2001).]