36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
import javax.swing.*;
|
|
import java.awt.*;
|
|
|
|
public class Rose {
|
|
public static void main(String[] args) {
|
|
|
|
Color vert = new Color(0,255,0);
|
|
Color noir = new Color(0,0,0);
|
|
JFrame fenetre = new JFrame("Question");
|
|
fenetre.setSize(500, 300);
|
|
fenetre.setLocation(0, 0);
|
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
Dimension minSize = new Dimension(300, 150);
|
|
fenetre.setMinimumSize(minSize);
|
|
FlowLayout flwLayout = new FlowLayout();
|
|
GridLayout grdLayout = new GridLayout(4, 1);
|
|
fenetre.setLayout(grdLayout);
|
|
JLabel question = new JLabel("Aimez-vous les chiens ?");
|
|
question.setHorizontalAlignment(JLabel.CENTER);
|
|
JPanel boutons = new JPanel();
|
|
boutons.setLayout(flwLayout);
|
|
JButton bouton1 = new JButton("Oui");
|
|
JButton bouton2 = new JButton("NSPP");
|
|
JButton bouton3 = new JButton("Non");
|
|
boutons.add(bouton1);
|
|
boutons.add(bouton2);
|
|
boutons.add(bouton3);
|
|
fenetre.add(new JLabel(""));
|
|
fenetre.add(question);
|
|
fenetre.add(boutons);
|
|
fenetre.add(new JLabel(""));
|
|
fenetre.setVisible(true);
|
|
|
|
|
|
}
|
|
} |