36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
import javax.sql.rowset.serial.SerialArray;
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
|
|
public class Choix {
|
|
public static void main(String[] args) {
|
|
// un objet pour servir de fenetre
|
|
JFrame fenetre = new JFrame();
|
|
// on configure la fenetre
|
|
fenetre.setSize(500, 300);
|
|
fenetre.setLocation(0, 0);
|
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
JRadioButton Gryffondor = new JRadioButton("Gryffondor");
|
|
Gryffondor.setHorizontalAlignment(JRadioButton.CENTER);
|
|
fenetre.add(Gryffondor, BorderLayout.NORTH);
|
|
|
|
JRadioButton Serdaigle = new JRadioButton("Serdaigle");
|
|
Serdaigle.setHorizontalAlignment(JRadioButton.CENTER);
|
|
fenetre.add(Serdaigle, BorderLayout.CENTER);
|
|
|
|
JRadioButton Serpentard = new JRadioButton("Serpentard");
|
|
Serpentard.setHorizontalAlignment(JRadioButton.CENTER);
|
|
fenetre.add(Serpentard, BorderLayout.SOUTH);
|
|
|
|
ButtonGroup Groupe = new ButtonGroup();
|
|
|
|
Groupe.add(Gryffondor);
|
|
Groupe.add(Serdaigle);
|
|
Groupe.add(Serpentard);
|
|
|
|
|
|
|
|
fenetre.setVisible(true);
|
|
}
|
|
} |