mouseMove not working appropriately
Can any one tell me what is the problem with the following code. I am trying to reposition the mouse cursor at the (0,0) co-ordinate of mouseTest frame, when mouse is dragged within it. But surprisingly mouse cursor goes to the (0,0) co-ordinate of the parent frame.
public class mouseTest extends JFrame {
public mouseTest() {
enableEvents(AWTEvent.MOUSE_EVENT_MASK|AWTEvent.MOUSE_MOTION_EVENT_MASK);
setSize(new Dimension(400,400));
setVisible(true);
}
public void processMouseMotionEvent(MouseEvent me){
if(me.getID() == MouseEvent.MOUSE_DRAGGED){
try{
Robot r = new Robot();
r.mouseMove(0,0);
}catch(AWTException ae){
}
}
else super.processMouseMotionEvent(me);
}
public static void main (String args[]) {
new mouseTest ().show ();
}
}
Any help will be appreciated. thanks in advance.

