This commit is contained in:
2024-03-18 13:54:22 +01:00
parent eb581c8a31
commit a28bef01d7
69 changed files with 855 additions and 5 deletions

Binary file not shown.

View File

@@ -6,17 +6,20 @@ public class Damier {
public static void main(String[] args) {
Color blanc = new Color(255,255,255);
Color cyan = new Color(0,255,255);
Color tab[] = {blanc,cyan};
int l = Integer.parseInt(args[0]);
System.out.println(l);
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setSize(500, 500);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout gestionnaire = new GridLayout(l, l);
fenetre.setLayout(gestionnaire);
JTextArea block = new JTextArea();
for (int i=0; i<(l*l); i++){
block.setBackground(tab[i%2]);
fenetre.add(block);
JTextField block = new JTextField(" ");
if (i % 2 == 0)
block.setBackground(blanc);
else
block.setBackground(cyan);
fenetre.add(block);
}
fenetre.setVisible(true);
}

Binary file not shown.

View File

@@ -0,0 +1,29 @@
import javax.swing.*;
import java.awt.*;
public class Question {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(500, 500);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout gestionnaire = new GridLayout(3, 3);
fenetre.setLayout(gestionnaire);
JPanel panneau = new JPanel();
JLabel phrase = new JLabel("Aimez-vous les chiens ?");
phrase.setHorizontalAlignment(JLabel.CENTER);
phrase.setVerticalAlignment(JLabel.BOTTOM);
JButton bouton = new JButton("Oui");
panneau.add(bouton);
JButton bouton1 = new JButton("Non");
panneau.add(bouton1);
JButton bouton2 = new JButton("NSPP");
panneau.add(bouton2);
for (int i = 0; i < 12; i++){
if (i == 5)
fenetre.add(phrase);
else if (i == 8)
fenetre.add(panneau);
}
fenetre.setVisible(true);
}
}