hi can you help me to modify this program to make it an isoceles or equilateral triangle? right now am having a right angle triangle!
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
public class Triangle extends Frame {
Line2D line1 = new Line2D.Double(50,150,150,150);
Line2D line2 = new Line2D.Double(50,50,150,150);
Line2D line3 = new Line2D.Double(50,50,50,150);
//Stroke drawingStroke = new BasicStroke(2);
public void paint(Graphics g)
{
Graphics2D graph = (Graphics2D)g;
//graph.setStroke(drawingStroke);
graph.setPaint(Color.blue);
graph.draw(line1);
graph.draw(line2);
graph.draw(line3);
}
public static void main(String args[])
{
Frame frame = new Triangle();
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
frame.setSize(1000, 1000);
frame.setVisible(true);
}
}