This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes awt.geom.generalpath assistance 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 » Beginning Java
Bookmark "awt.geom.generalpath assistance" Watch "awt.geom.generalpath assistance" New topic
Author

awt.geom.generalpath assistance

Mike McMahon
Ranch Hand

Joined: May 07, 2005
Posts: 30
Hey Everyone,

I've been playing with the generalPath class, and am happy with how it works. I had previously looked at the awt.geom.Polygon class, but didn't like that it didn't accept floats.

Now that I'm using the generalpath class, I've noticed a big disadvantage from the polygon class - there's no npoints() method!. This method tells me how many points are in the path. I need to know this, because points (n=1), lines (n=2) and polygons (n>2) all need to be treated differently.

I've currently got, the following working - but it seems clunky. Can anyone either confirm that this is a good way to approach this, or suggest an alternative?

 
Don't get me started about those stupid light bulbs.
 
subject: awt.geom.generalpath assistance
 
Similar Threads
super.painComponent(g) not clearing my Jpanel
Comparing co-ordinates
Fill in the Blanks
Access a variable