olá pessoal,
Estou precisando pintar um triângulo que desenhei usando o drawLine, alguma sugestão?
class Triangle implements Forma{
Integer x1, y1, x2, y2, x3, y3;
@Override
public void draw(Graphics2D graph, Color color, Integer posX, Integer posY) {
graph.setColor(color);
x1 = posX;
y1 = posY;
x2 = posX +50;
y2 = posY -100;
x3 = posX +100;
y3 = posY;
graph.drawLine(x1, y1, x2, y2);
graph.drawLine(x2, y2, x3, y3);
graph.drawLine(x3, y3, x1, y1);
}