diff --git a/DEV.2.1/TP/TP2-CompGraphique/Boutons.java b/DEV.2.1/TP/TP2-CompGraphique/Boutons.java index d833de6..e53719d 100644 --- a/DEV.2.1/TP/TP2-CompGraphique/Boutons.java +++ b/DEV.2.1/TP/TP2-CompGraphique/Boutons.java @@ -8,21 +8,22 @@ public class Boutons JFrame frame = new JFrame("Boutons"); JButton btn1 = new JButton("Luc Hernandez prof de DEV"); - btn1.setBounds(100,100,100,40); + btn1.setSize(100,100); JButton btn2 = new JButton("Pierre"); - btn2.setBounds(50,100,100,40); + btn2.setBounds(50,100,50,40); JButton btn3 = new JButton("Louqa"); - btn3.setBounds(150,100,100,40); + btn3.setBounds(150,100,50,40); JButton btn4 = new JButton("ok"); - btn4.setBounds(200,100,100,40); + btn4.setBounds(200,100,50,40); JButton btn5 = new JButton("bou"); - btn5.setBounds(250,100,100,40); - - frame.add(btn1); + btn5.setBounds(250,100,50,40); + btn1.setHorizontalAlignment(JLabel.LEFT); + btn1.setVerticalAlignment(JLabel.BOTTOM); + frame.add(btn1, BorderLayout.WEST); frame.add(btn2); frame.add(btn3); frame.add(btn4); diff --git a/DEV.2.1/TP/TP2-CompGraphique/Choix.java b/DEV.2.1/TP/TP2-CompGraphique/Choix.java new file mode 100644 index 0000000..02abc82 --- /dev/null +++ b/DEV.2.1/TP/TP2-CompGraphique/Choix.java @@ -0,0 +1,27 @@ +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); + + JRadioButton gryf = new JRadioButton("Gryffondor"); + JRadioButton serd = new JRadioButton("Serdaigle"); + JRadioButton serp = new JRadioButton("Serpentard"); + + gryf.setHorizontalAlignment(JRadioButton.CENTER); + serd.setHorizontalAlignment(JRadioButton.CENTER); + serp.setHorizontalAlignment(JRadioButton.CENTER); + + frame.add(gryf, BorderLayout.NORTH); + frame.add(serd, BorderLayout.CENTER); + frame.add(serp, BorderLayout.SOUTH); + + + frame.setSize(1000,500); + frame.setLocation(500,250); + frame.setVisible(true); + + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP2-CompGraphique/Contingences.java b/DEV.2.1/TP/TP2-CompGraphique/Contingences.java new file mode 100644 index 0000000..fd424a2 --- /dev/null +++ b/DEV.2.1/TP/TP2-CompGraphique/Contingences.java @@ -0,0 +1,10 @@ +public class Contingences { + public static void main(String[] args){ + JFrame frame = new JFrame("Choix"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + frame.setSize(1000,500); + frame.setLocation(500,250); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP2-CompGraphique/Saisie.java b/DEV.2.1/TP/TP2-CompGraphique/Saisie.java index c57aae1..6a65564 100644 --- a/DEV.2.1/TP/TP2-CompGraphique/Saisie.java +++ b/DEV.2.1/TP/TP2-CompGraphique/Saisie.java @@ -1,15 +1,24 @@ -import javax.swing.JFrame; -import javax.swing.JTextField; +import javax.swing.*; +import java.awt.*; public class Saisie { public static void main(String[] args){ JFrame fenetre = new JFrame("Saisie"); - + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JTextArea textarea = new JTextArea(); JTextField saisie = new JTextField(); - saisie.setColumns(0); + + textarea.setBackground(new Color(0, 0, 0)); + saisie.setBackground(new Color(128, 128, 128)); + textarea.setForeground(new Color(0, 128, 0)); + saisie.setForeground(new Color(0, 128, 0).darker()); + - frame.setSize(300,300); - frame.setLayout(null); - frame.setVisible(true); + fenetre.add(saisie, BorderLayout.SOUTH); + fenetre.add(textarea, BorderLayout.CENTER); + fenetre.setSize(500, 300); + fenetre.setLocation(500,250); + fenetre.setVisible(true); } } \ No newline at end of file diff --git a/DEV.2.1/TP/TP2-CompGraphique/Sirocco.java b/DEV.2.1/TP/TP2-CompGraphique/Sirocco.java index e524972..e233962 100644 --- a/DEV.2.1/TP/TP2-CompGraphique/Sirocco.java +++ b/DEV.2.1/TP/TP2-CompGraphique/Sirocco.java @@ -5,10 +5,12 @@ public class Sirocco { public static void main(String[] args) { JFrame fenetre = new JFrame("Sirocco"); fenetre.setSize(500, 300); - fenetre.setLocation(100, 100); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JLabel etiquette = new JLabel("Sirocco"); - etiquette.setHorizontalAlignment(JLabel.BOTTOM_ALIGNMENT); + etiquette.setHorizontalAlignment(JLabel.LEFT); + etiquette.setVerticalAlignment(JLabel.BOTTOM); + fenetre.add(etiquette, BorderLayout.CENTER); fenetre.setVisible(true);