wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes adding MouseMotionListener to rectangle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "adding MouseMotionListener to rectangle" Watch "adding MouseMotionListener to rectangle" New topic
Author

adding MouseMotionListener to rectangle

Bob Mazz
Greenhorn

Joined: Mar 17, 2004
Posts: 5
Hi there. I have a JFrame paintComponent method that draws a rectangle when called as follows :
paintComponent(new Color(255,0,0), "Menu",300, 130, 270, 100);
I then call an instance of a class 'amenu':
amenu mymenu = new amenu(menucount, objectcount, 1, 3, 4, 5, 6);
the two need to be linked so the paint rectangle references the instance of the menu because next I need to be able to add a MouseMotionListener to the rectangles to move them. Any suggestions? Cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding MouseMotionListener to rectangle