How to draw a triangle in Java?
Posted by Paul on April 24th 2018 06:17 AM
Program to draw a triangle in Java : For drawing a circle in Java you can use Line2D class provided by java in java.awt.geom.* package. This class provides a line segment in (x, y) coordinate space. You just need to draw three lines using Line2D Class in order to draw a triangle. setPaint() : This method paints the line segment Here is the code :