-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEssai.java
More file actions
75 lines (53 loc) · 1.74 KB
/
Essai.java
File metadata and controls
75 lines (53 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
public class Essai extends JFrame{
private JPanel container = new JPanel();
private ChoixTableau choix;
private JMenuBar menuBar = new JMenuBar();
private JMenu animation = new JMenu("Animation"),
forme = new JMenu("Forme"),
typeForme = new JMenu("Type de forme"),
aPropos = new JMenu("À propos");
private JMenuItem lancer = new JMenuItem("Lancer l'animation"),
arreter = new JMenuItem("Arrêter l'animation"),
quitter = new JMenuItem("Quitter"),
aProposItem = new JMenuItem("?");
private JMenuItem carre = new JMenuItem("Carré"),
rond = new JMenuItem("Rond"),
triangle = new JMenuItem("Triangle"),
etoile = new JMenuItem("Etoile");
public Essai(){
this.setTitle("Animation");
this.setSize(300, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
container.setBackground(Color.white);
container.setLayout(new BorderLayout());
//Menu animation
animation.add(lancer);
animation.add(arreter);
animation.add(quitter);
forme.add(new ChoixTableau());
forme.add(new JMenuItem("Insérer un tableau..."));
//Menu À propos
aPropos.add(aProposItem);
//Ajout des menus dans la barre de menus
menuBar.add(animation);
menuBar.add(forme);
menuBar.add(aPropos);
//Ajout de la barre de menus sur la fenêtre
this.setJMenuBar(menuBar);
this.setContentPane(container);
this.setVisible(true);
}
public static void main(String[] args)
{
new Essai();
}
}