Java
This commit is contained in:
parent
08f8c6f578
commit
47e6f3b0a4
BIN
APL2.1/TP2/Choix.class
Normal file
BIN
APL2.1/TP2/Choix.class
Normal file
Binary file not shown.
24
APL2.1/TP2/Choix.java
Normal file
24
APL2.1/TP2/Choix.java
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user