This commit is contained in:
Emmanuel Srivastava
2025-01-28 15:57:06 +01:00
parent ca261102e6
commit 1d439aff05
5 changed files with 65 additions and 16 deletions

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);