I'm having issues with implementing MouseListener and MouseMotionListener, it continues to say that MyMouseMotionListener must implement the inherited abstract method MouseMotionListener.mouseDragged(MouseEvent), but as you can see in my code below, I have, thus leading to my confusion. Any Ideas?
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class MouseRectangleAnimation extends JApplet{
int x, y;
public void init(){
addMouseMotionListener(new MyMouseMotionListener());
}
public class MyMouseMotionListener implements MouseMotionListener{
public void mouseMoved(MouseEvent e){
x = e.getX();
y = e.getY();
repaint();
}
public void mouseDragged(MouseEvent e){
}
}
}
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class MouseRectangleAnimation extends JApplet{
int x, y;
public void init(){
addMouseMotionListener(new MyMouseMotionListener());
}
public class MyMouseMotionListener implements MouseMotionListener{
public void mouseMoved(MouseEvent e){
x = e.getX();
y = e.getY();
repaint();
}
public void mouseDragged(MouseEvent e){
}
}
}