This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding MouseMotionListener to rectangle

 
Bob Mazz
Greenhorn
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