29 lines
906 B
Java
29 lines
906 B
Java
|
|
import javax.swing.*;
|
||
|
|
import java.awt.*;
|
||
|
|
|
||
|
|
public class Question {
|
||
|
|
public static void main(String[] args) {
|
||
|
|
JFrame fenetre = new JFrame();
|
||
|
|
fenetre.setSize(500, 500);
|
||
|
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
|
|
GridLayout gestionnaire = new GridLayout(3, 3);
|
||
|
|
fenetre.setLayout(gestionnaire);
|
||
|
|
JPanel panneau = new JPanel();
|
||
|
|
JLabel phrase = new JLabel("Aimez-vous les chiens ?");
|
||
|
|
phrase.setHorizontalAlignment(JLabel.CENTER);
|
||
|
|
phrase.setVerticalAlignment(JLabel.BOTTOM);
|
||
|
|
JButton bouton = new JButton("Oui");
|
||
|
|
panneau.add(bouton);
|
||
|
|
JButton bouton1 = new JButton("Non");
|
||
|
|
panneau.add(bouton1);
|
||
|
|
JButton bouton2 = new JButton("NSPP");
|
||
|
|
panneau.add(bouton2);
|
||
|
|
for (int i = 0; i < 12; i++){
|
||
|
|
if (i == 5)
|
||
|
|
fenetre.add(phrase);
|
||
|
|
else if (i == 8)
|
||
|
|
fenetre.add(panneau);
|
||
|
|
}
|
||
|
|
fenetre.setVisible(true);
|
||
|
|
}
|
||
|
|
}
|