34 lines
976 B
Java
34 lines
976 B
Java
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
|
||
|
public class Question{
|
||
|
public static void main(String[] args) {
|
||
|
// un objet pour servir de fenetre
|
||
|
JFrame fenetre = new JFrame("Question");
|
||
|
// on configure la fenetre
|
||
|
fenetre.setSize(500, 250);
|
||
|
fenetre.setLocation(0, 0);
|
||
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
|
|
||
|
GridLayout grille = new GridLayout(2,1);
|
||
|
fenetre.setLayout(grille);
|
||
|
|
||
|
JLabel texte = new JLabel("Aimez vous les chiens");
|
||
|
texte.setHorizontalAlignment(JLabel.CENTER);
|
||
|
fenetre.add(texte, BorderLayout.CENTER);
|
||
|
|
||
|
JPanel panneau = new JPanel();
|
||
|
|
||
|
JButton bouton = new JButton("Oui");
|
||
|
JButton bouton2 = new JButton("Non");
|
||
|
JButton bouton3 = new JButton("NSPP");
|
||
|
panneau.add(bouton);
|
||
|
panneau.add(bouton2);
|
||
|
panneau.add(bouton3);
|
||
|
fenetre.add(panneau, BorderLayout.SOUTH);
|
||
|
Dimension size = new Dimension(250,125);
|
||
|
fenetre.setMinimumSize(size);
|
||
|
fenetre.setVisible(true);
|
||
|
}
|
||
|
}
|