Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Swing / AWT / SWT and the fly likes Problem with Coordinates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with Coordinates" Watch "Problem with Coordinates" New topic

Problem with Coordinates

Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
Hi all

In my graphics application , i rotated my polygon by angle -45 .

Now when i notice the mouse event over polygon , the method contains

always return false because of rotation , the x and y of polygon has been changed.

Plz suggest me how to apply polygon.contains method which will return true when i click over polygon


Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
I agree. Here's the link:
subject: Problem with Coordinates
Similar Threads
Adding a custom component to a layout?
Disappearing Graphics on panel
J2SE 1.5.0 fillPolygon method
Background image
J2SE 1.5.0 Graphics.fillPolygon method