triangles

Hey how do you draw triangles in Java? all i need to know is the"g.drawTriangle(100,100,100,100); " i know thats not right but how do you draw one?
[161 byte] By [CompSci_majora] at [2007-10-2 2:55:45]
# 1
ok, i have this as my triangle: g.drawLine(50,50,25,100); g.drawLine(25,100,75,100); g.drawLine(50,50,75,100);now how do i fill it in ?
CompSci_majora at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 2
Do you know this little utility called [url http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&hl=en&q=draw+triangle+site%3Aforum.java.sun.com&btnG=Google+Search]Google[/url]?
jfbrierea at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 3
yeh i already used it and found nothing
CompSci_majora at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 4
Look at some of the fill methods in this class.
FuzzyOniona at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 5
By the way, that class is: http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html
FuzzyOniona at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 6
> yeh i already used it and found nothingYou bring credit to CS majors everywhere.
-Kayaman-a at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 7
You may want to consider that a triangle is a special case of a polygon, and then look at Graphics methods that start with "fill".
paulcwa at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...
# 8

> > yeh i already used it and found nothing

>

> You bring credit to CS majors everywhere.

Oh, be nice, maybe he's a freshman and hasn't learned much yet.

Though, seriously, OP: you better learn to do this kind of research, because you're going to do a lot of it.

paulcwa at 2007-7-15 21:21:32 > top of Java-index,Java Essentials,Java Programming...