APL/APL2.1/TP02/Choix/Choix.java

25 lines
823 B
Java
Raw Normal View History

2022-02-07 17:26:04 +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.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ButtonGroup houses = new ButtonGroup();
JRadioButton gryffondor = new JRadioButton("Gryffondor");
JRadioButton serpentard = new JRadioButton("Serpentard");
JRadioButton serdaigle = new JRadioButton("Serdaigle");
houses.add(gryffondor);
houses.add(serpentard);
houses.add(serdaigle);
fenetre.add(gryffondor, BorderLayout.NORTH);
fenetre.add(serpentard, BorderLayout.CENTER);
fenetre.add(serdaigle, BorderLayout.SOUTH);
fenetre.setVisible(true);
}
}