View Single Post
  #3 (permalink)  
Old 08-04-2007, 05:15 AM
cruxblack cruxblack is offline
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
Just like hardwired just said, the compiler might not give u an error by doing
Code:
public void mouseMove(MouseEvent e){ int x_pos=e.getX(); }
But u r declaring another x_pos in that mouseMove() method, in which the class variable x_pos must be refered as this.x_pos, not a very good on this context though

And btw, if im not mistaken, by implementing MouseMotionListener we must override the method mouseDraggeed() and mouseMoved right?
Just like hardwired just done there, if not the compiler would complain, maybe ur other listeners don't work because u didn't override the correct methods for that listener?
Reply With Quote