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
| import javax.swing.JButton;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
public class fenetre extends JFrame implements ActionListener {
private JButton bouton1;
private JButton bouton2;
private JButton bouton3;
public fenetre() {
this.setTitle("Animation");
this.setSize(300, 150);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setVisible(true);
this.setContentPane(buildContentPane());
}
private JPanel buildContentPane() {
JPanel pan = new JPanel();
pan.setLayout(new GridLayout(1, 1));
bouton1 = new JButton(new emplAction("Employee"));
pan.add(bouton1);
bouton2 = new JButton(new techAction("Technicien"));
pan.add(bouton2);
bouton3 = new JButton(new serAction("Service"));
pan.add(bouton3);
return(pan);
}
} |
Partager