Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding MouseMotionListener to rectangle

Bob Mazz
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic