APL/APL2.1/TP2/Boutons.java
2022-02-07 10:53:37 +01:00

21 lines
787 B
Java

import javax.swing.*;
import java.awt.*;
public class Boutons {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(500,300);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton bouton1 = new JButton("Bouton1");
fenetre.add(bouton1, BorderLayout.WEST);
JButton bouton2 = new JButton("Bouton2");
fenetre.add(bouton2, BorderLayout.NORTH);
JButton bouton3 = new JButton("Bouton3");
fenetre.add(bouton3, BorderLayout.EAST);
JButton bouton4 = new JButton("Bouton4");
fenetre.add(bouton4, BorderLayout.SOUTH);
JButton bouton5 = new JButton("Bouton5");
fenetre.add(bouton5, BorderLayout.CENTER);
fenetre.setVisible(true);
}
}