APL/APL2.1/TP2/Choix.java

24 lines
920 B
Java
Raw Normal View History

2022-02-07 11:05:59 +01:00
import javax.swing.*;
import java.awt.*;
public class Choix {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(500,300);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ButtonGroup Cheh = new ButtonGroup();
JRadioButton bouton8 = new JRadioButton("Gryffondor");
Cheh.add (bouton8);
fenetre.add(bouton8, BorderLayout.NORTH);
bouton8.setVerticalAlignment(JLabel.CENTER);
JRadioButton bouton9 = new JRadioButton("Serdaigle");
Cheh.add (bouton9);
fenetre.add(bouton9, BorderLayout.CENTER);
bouton9.setVerticalAlignment(JLabel.CENTER);
JRadioButton bouton10 = new JRadioButton("Serpentard");
Cheh.add (bouton10);
fenetre.add(bouton10, BorderLayout.SOUTH);
bouton10.setVerticalAlignment(JLabel.CENTER);
fenetre.setVisible(true);
}
}