Hi, I'm having trouble making a game work. I cant get my mouse to react to my applet at all. I've tried a few different methods, and a few different listeners types but haven't been successful with anything yet. Everything I have tried except for EventListeners has failed. I could use some serious help.
Her is what I have right now.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Catcher extends Applet implements MouseMotionListener{
int x_pos;
int y_pos;
public void init(){
addMouseMotionListener(this)
}
public void mouseMove(MouseEvent e){
int x_pos=e.getX();
}
public void paint(Graphics g){
g.setColor(Color.blue);
g.fillRect(x_pos-25,y_pos-5,50,10);
}
}
Is there anyone that has done Applet coding before that could help?
Thanks.