diff --git a/DEV.2.1/TP/TP2-CompGraphique/test.java b/DEV.2.1/TP/TP2-CompGraphique/test.java new file mode 100644 index 0000000..16be252 --- /dev/null +++ b/DEV.2.1/TP/TP2-CompGraphique/test.java @@ -0,0 +1,20 @@ +import java.awt.BorderLayout; + +import javax.swing.JFrame; +import javax.swing.JTextField; + + +public class test { + public static void main(String[] args) { + JFrame f = new JFrame(); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + + f.setLayout(new BorderLayout()); + JTextField tf = new JTextField(); + f.setSize(500, 300); + f.setLocation(500,250); + f.setVisible(true); + } +} + diff --git a/DEV.2.1/TP/TP3-MiseenPage/Choix.class b/DEV.2.1/TP/TP3-MiseenPage/Choix.class new file mode 100644 index 0000000..ce145e4 Binary files /dev/null and b/DEV.2.1/TP/TP3-MiseenPage/Choix.class differ diff --git a/DEV.2.1/TP/TP3-MiseenPage/Choix.java b/DEV.2.1/TP/TP3-MiseenPage/Choix.java new file mode 100644 index 0000000..ba29895 --- /dev/null +++ b/DEV.2.1/TP/TP3-MiseenPage/Choix.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; + +public class Choix { + public static void main(String[] args){ + JFrame frame = new JFrame("Choix"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + GridLayout gestionnaire = new GridLayout(4, 1); + frame.setLayout(gestionnaire); + + + JRadioButton gryf = new JRadioButton("Gryffondor"); + JRadioButton serd = new JRadioButton("Serdaigle"); + JRadioButton serp = new JRadioButton("Serpentard"); + JRadioButton pouf = new JRadioButton("Poufsouffle"); + + gryf.setHorizontalAlignment(JRadioButton.CENTER); + serd.setHorizontalAlignment(JRadioButton.CENTER); + serp.setHorizontalAlignment(JRadioButton.CENTER); + pouf.setHorizontalAlignment(JRadioButton.CENTER); + + frame.add(gryf); + frame.add(serd); + frame.add(serp); + frame.add(pouf); + + frame.setSize(1000,500); + frame.setLocation(500,250); + frame.setVisible(true); + + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP3-MiseenPage/Damier.class b/DEV.2.1/TP/TP3-MiseenPage/Damier.class new file mode 100644 index 0000000..040b704 Binary files /dev/null and b/DEV.2.1/TP/TP3-MiseenPage/Damier.class differ diff --git a/DEV.2.1/TP/TP3-MiseenPage/Damier.java b/DEV.2.1/TP/TP3-MiseenPage/Damier.java new file mode 100644 index 0000000..4e1785c --- /dev/null +++ b/DEV.2.1/TP/TP3-MiseenPage/Damier.java @@ -0,0 +1,34 @@ +import javax.swing.*; +import java.awt.*; + +public class Damier { + public static void main(String[] args){ + JFrame frame = new JFrame("Damier"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + int xpan = Integer.parseInt(args[0]); + int ypan; + ypan = xpan; + + GridLayout gestionnaire = new GridLayout(xpan, ypan); + frame.setLayout(gestionnaire); + + for(int i = 0; i < xpan*ypan; i++){ + if(i % 2 == 0){ + JPanel panneau = new JPanel(); + panneau.setBackground(Color.WHITE); + frame.add(panneau); + }else{ + JPanel panneau = new JPanel(); + panneau.setBackground(Color.CYAN); + frame.add(panneau); + } + } + + + frame.setSize(500,500); + frame.setLocation(500,250); + frame.setVisible(true); + + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP3-MiseenPage/Piege.class b/DEV.2.1/TP/TP3-MiseenPage/Piege.class new file mode 100644 index 0000000..9c0821a Binary files /dev/null and b/DEV.2.1/TP/TP3-MiseenPage/Piege.class differ diff --git a/DEV.2.1/TP/TP3-MiseenPage/Piege.java b/DEV.2.1/TP/TP3-MiseenPage/Piege.java new file mode 100644 index 0000000..3c479e8 --- /dev/null +++ b/DEV.2.1/TP/TP3-MiseenPage/Piege.java @@ -0,0 +1,25 @@ +import javax.swing.*; +import java.awt.*; + +public class Piege { + public static void main(String[] args){ + JFrame frame = new JFrame("Piege"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setLayout(null); + + JButton btn1 = new JButton("1"); + btn1.setLocation(1,1); + btn1.setSize(400,50); + + JButton btn2 = new JButton("2"); + btn2.setLocation(400,1); + btn2.setSize(100,400); + + frame.add(btn1); + frame.add(btn2); + frame.setSize(500,500); + frame.setLocation(500,250); + frame.setVisible(true); + + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP3-MiseenPage/Question.java b/DEV.2.1/TP/TP3-MiseenPage/Question.java new file mode 100644 index 0000000..d1019d2 --- /dev/null +++ b/DEV.2.1/TP/TP3-MiseenPage/Question.java @@ -0,0 +1,27 @@ +import javax.swing.*; +import java.awt.*; + +public class Question { + public static void main(String[] args){ + JFrame frame = new JFrame("Question"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + frame.setLayout(new BorderLayout()); + + JLabel etiquette = new JLabel("Aimez-vous les chats ?", SwingConstants.CENTER); + JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + JButton btn1 = new JButton("Oui"); + JButton btn2 = new JButton("Non"); + JButton btn3 = new JButton("NSPP"); + + buttonPanel.add(btn1); + buttonPanel.add(btn2); + buttonPanel.add(btn3); + + frame.add(etiquette, BorderLayout.NORTH); + frame.add(buttonPanel, BorderLayout.SOUTH); + frame.setSize(380,120); + frame.setLocation(500,250); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP3-MiseenPage/Rose.java b/DEV.2.1/TP/TP3-MiseenPage/Rose.java new file mode 100644 index 0000000..9491d81 --- /dev/null +++ b/DEV.2.1/TP/TP3-MiseenPage/Rose.java @@ -0,0 +1,30 @@ +import javax.swing.*; +import java.awt.*; + +public class Rose { + public static void main(String[] args) { + JFrame frame = new JFrame("Rose"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // Créer un panel avec un GridLayout pour organiser les labels + JPanel panel = new JPanel(new GridLayout(0, 1)); // Une colonne, autant de lignes que nécessaire + + // Ajouter les labels avec les noms + panel.add(new JLabel("Mystral", SwingConstants.CENTER)); + panel.add(new JLabel("Tramontane", SwingConstants.CENTER)); + panel.add(new JLabel("Grec", SwingConstants.CENTER)); + panel.add(new JLabel("Ponant", SwingConstants.CENTER)); + panel.add(new JLabel("Levant", SwingConstants.CENTER)); + panel.add(new JLabel("Libeccio", SwingConstants.CENTER)); + panel.add(new JLabel("Marin", SwingConstants.CENTER)); + panel.add(new JLabel("Sirocco", SwingConstants.CENTER)); + + // Ajouter le panel à la frame + frame.add(panel, BorderLayout.CENTER); + + // Configurer la taille et la position de la frame + frame.setSize(300, 200); + frame.setLocationRelativeTo(null); // Centrer la fenêtre sur l'écran + frame.setVisible(true); + } +} \ No newline at end of file