DEV/DEV2.1/TP1:ComposantsGraphiques/Boutons.java

24 lines
629 B
Java
Raw Normal View History

2023-02-13 11:29:17 +01:00
import javax.swing.*;
import java.awt.*;
public class Boutons {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
JPanel pan = new JPanel();
fenetre.setSize(400, 200);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton bouton1 = new JButton();
JButton bouton2 = new JButton();
JButton bouton3 = new JButton();
JButton bouton4 = new JButton();
JButton bouton5 = new JButton();
pan.add(bouton1);
pan.add(bouton2);
pan.add(bouton3);
pan.add(bouton4);
pan.add(bouton5);
fenetre.setContentPane(pan);
fenetre.setVisible(true);
}
}