aspose file tools*
The moose likes Applets and the fly likes Graphics: triangle()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Graphics: triangle()?" Watch "Graphics: triangle()?" New topic
Author

Graphics: triangle()?

Jason Shadle
Greenhorn

Joined: Sep 20, 2010
Posts: 1
Hello all...first post. Tons of help great info on this site. Will be using frequently.

So first question:

What class,method, or even formula, can I use to create a triangle on my applet? It's strange to me that there is a fillOval, fillRect, etc...But there is no fillTriangle, or drawTriangle?


Thanks in advance.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Jason Shadle wrote:Hello all...first post. Tons of help great info on this site. Will be using frequently.

And a hearty welcome to the Ranch!

What class,method, or even formula, can I use to create a triangle on my applet? It's strange to me that there is a fillOval, fillRect, etc...But there is no fillTriangle, or drawTriangle?


Similarly, there's no drawPentagon, drawHexagon, drawHeptagon, drawOctagon, etc...
But if they did have some of these, where would they draw the line and have no more?

Check out the API entry for the Graphics class and you'll see many other useful methods including drawPolygon and fillPolygon. Also if you want to delve into Graphics2D, you'll likewise find some classes that implement Shape that you can use.

Much luck!
 
jQuery in Action, 2nd edition
 
subject: Graphics: triangle()?