Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conflicting Mouse Events

 
George Jacobs
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't done much Java GUI programming, but I have inherited a program that involves a Java GUI.

I am wondering how I can use a mouse event to draw a box on a GUI and then calculate the distance from the box to the mouse. I am trying to essentially combine these 2 programs together.



Program 2:


I am trying to replace the red rectangle with the user drawn box. I also don't need the box to be redrawn, but some sort of Calculate box. Does anybody know how I can do this in Java without all these conflicting mouse events? I really appreciate any help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic