DEV/DEV2.1/TP4/Chien.java

23 lines
648 B
Java
Raw Normal View History

2023-03-27 11:21:24 +02:00
import javax.swing.*;
import java.awt.*;
public class Chien {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
FlowLayout main = new FlowLayout(FlowLayout.CENTER);
fenetre.setLayout(main);
fenetre.setSize(500, 500);
fenetre.setLocation(0, 0);
JLabel question = new JLabel("Aimez-vous les chiens ?");
question.setHorizontalAlignment(JLabel.CENTER);
fenetre.add(question, BorderLayout.CENTER);
fenetre.add(new JButton("Oui"));
fenetre.add(new JButton("Non"));
fenetre.add(new JButton("NSPP"));
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setVisible(true);
}
}