24 lines
582 B
Java
24 lines
582 B
Java
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
import java.awt.event.*;
|
||
|
import java.awt.Polygon;
|
||
|
|
||
|
public class Q5Main{
|
||
|
public static void main(String[] args) {
|
||
|
|
||
|
JFrame fenetre = new JFrame("Q1 Galerie");
|
||
|
fenetre.setSize(300, 200);
|
||
|
fenetre.setLocation(700, 300);
|
||
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
|
|
||
|
Polygon etoile = new Polygon();
|
||
|
etoile.addPoint(50,50);
|
||
|
etoile.addPoint(300,140);
|
||
|
etoile.addPoint(230,80);
|
||
|
etoile.addPoint(10,330);
|
||
|
fenetre.setVisible(true);
|
||
|
|
||
|
Q5Polygon dessinEtoile = new Q5Polygon(etoile);
|
||
|
fenetre.add(dessinEtoile);
|
||
|
}
|
||
|
}
|