How can I draw a star in java? The part that confuses me is that of the coordinates in g.drawline because I do not understand in what order they are written and how to give me an idea of the correct coordinates to draw a star.
This is what I have from my code.
import java.awt.*;
import javax.swing.*;
class Pantalla extends Frame{
public static void main(String[]args)
{
Pantalla p=new Pantalla();
JOptionPane.showMessageDialog(null,"bienvenido sistema de algo");
}
public Pantalla()
{
this.setSize(1600,900);
setBackground(new Color(200,0,180));
this.setVisible(true);
}
public void paint(Graphics g)
{
g.setColor(new Color(255,0,0));
g.drawString("Hola",400,100);
g.drawLine(400,100,800,100);
g.drawLine(500,150,450,200);
g.drawLine(500,150,550,200);
g.drawLine(350,100,200,250);
}
}