MouseDragged Flicker Image
Hi, I'm trying to drag a JPanel containing 2D Graphics and I have used a
mouseDragged listener. The image drags but the problem is is that it flickers inbetween two possible locations for some reason. Here is my code:
publicvoid mouseDragged(java.awt.event.MouseEvent mouseEvent){
((JPanel)mouseEvent.getSource()).setLocation(mouseEvent.getX(), mouseEvent.getY());
}
I printed out the coordinates and for some reason they jump from high coords down to lows like
x 119 y 66 down to x 18 y 13 , but i can't figure it out.
Does anyone know why this may be? thanks
Message was edited by:
kerryblue19

