public void mousePressed(MouseEvent evt){
  downx=evt.getX();
  downy=evt.getY();
}

public void mousePressed ( MouseEvent evt ) { downx = evt . getX ( ) ; downy = evt . getY ( ) ; }
handles a mousepressed event
