This commit is contained in:
Vieira Enzo 2022-02-07 11:05:59 +01:00
parent 08f8c6f578
commit 47e6f3b0a4
2 changed files with 24 additions and 0 deletions

BIN
APL2.1/TP2/Choix.class Normal file

Binary file not shown.

24
APL2.1/TP2/Choix.java Normal file
View File

@ -0,0 +1,24 @@
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);
}
}