TriangleDrawerComponent Java
TriangleDrawerComponent Java
*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
//This class handles the drawing of the triangle and mouse interactions.
public class TriangleDrawerComponent extends JComponent {
private Point[] points;
private int clickCount;
//Constructor for the points array and sets up the mouse listener
public TriangleDrawerComponent() {
points = new Point[3];
clickCount = 0;
addMouseListener(new MouseAdapter() {