update
This commit is contained in:
@@ -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);
|
||||
|
27
DEV.2.1/TP/TP2-CompGraphique/Choix.java
Normal file
27
DEV.2.1/TP/TP2-CompGraphique/Choix.java
Normal 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);
|
||||
|
||||
}
|
||||
}
|
10
DEV.2.1/TP/TP2-CompGraphique/Contingences.java
Normal file
10
DEV.2.1/TP/TP2-CompGraphique/Contingences.java
Normal 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);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user