diff --git a/APL2.1/TP3/Choix.class b/APL2.1/TP3/Choix.class new file mode 100644 index 0000000..760cd3d Binary files /dev/null and b/APL2.1/TP3/Choix.class differ diff --git a/APL2.1/TP3/Choix.java b/APL2.1/TP3/Choix.java new file mode 100644 index 0000000..9be41f4 --- /dev/null +++ b/APL2.1/TP3/Choix.java @@ -0,0 +1,29 @@ +import javax.swing.*; +import java.awt.*; + +public class Choix { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500,300); + fenetre.setMinimumSize(new Dimension(300, 200)); + 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); + JRadioButton bouton11 = new JRadioButton("Poufsouffle"); + Cheh.add (bouton11); + fenetre.add(bouton11, BorderLayout.EAST); + bouton10.setVerticalAlignment(JLabel.CENTER); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP3/Damier.class b/APL2.1/TP3/Damier.class new file mode 100644 index 0000000..2100136 Binary files /dev/null and b/APL2.1/TP3/Damier.class differ diff --git a/APL2.1/TP3/Damier.java b/APL2.1/TP3/Damier.java new file mode 100644 index 0000000..cc3d3f1 --- /dev/null +++ b/APL2.1/TP3/Damier.java @@ -0,0 +1,26 @@ +import javax.swing.*; +import java.awt.*; + +public class Damier { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500,300); + fenetre.setMinimumSize(new Dimension(300, 200)); + GridLayout gestionnaire = new GridLayout(Integer.parseInt(args[0]), Integer.parseInt(args[0])); + fenetre.setLayout(gestionnaire); + for(int i = 0; i < Integer.parseInt(args[0])*Integer.parseInt(args[0]) ; i++){ + JPanel panneau = new JPanel(); + if((i%2)==1) + { + panneau.setBackground(Color.white); + fenetre.add(panneau); + } + else + { + panneau.setBackground(Color.cyan); + fenetre.add(panneau); + } + } + fenetre.setVisible(true); + } +} diff --git a/APL2.1/TP3/Question.class b/APL2.1/TP3/Question.class new file mode 100644 index 0000000..4377924 Binary files /dev/null and b/APL2.1/TP3/Question.class differ diff --git a/APL2.1/TP3/Question.java b/APL2.1/TP3/Question.java new file mode 100644 index 0000000..590d566 --- /dev/null +++ b/APL2.1/TP3/Question.java @@ -0,0 +1,21 @@ +import javax.swing.*; +import java.awt.*; + +public class Question { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500,300); + fenetre.setMinimumSize(new Dimension(300, 200)); + GridLayout gestionnaire = new GridLayout(3,3); + fenetre.setLayout(gestionnaire); + JPanel panneau = new JPanel(); + JButton bouton = new JButton("Oui"); + panneau.add(bouton); + JButton bouton2 = new JButton("Non"); + panneau.add(bouton2); + JButton bouton3 = new JButton("NSPP"); + panneau.add(bouton3); + fenetre.add(panneau); + fenetre.setVisible(true); + } +}