moitié tp 3
This commit is contained in:
BIN
DEV2.1/Mise_page/Choix.class
Normal file
BIN
DEV2.1/Mise_page/Choix.class
Normal file
Binary file not shown.
26
DEV2.1/Mise_page/Choix.java
Normal file
26
DEV2.1/Mise_page/Choix.java
Normal file
@@ -0,0 +1,26 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Choix {
|
||||
public static void main(String[] args) {
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 300);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
GridLayout gestionnaire = new GridLayout(4, 1);
|
||||
fenetre.setLayout(gestionnaire);
|
||||
JRadioButton etiquette = new JRadioButton("Gryffondor");
|
||||
JRadioButton etiquette1 = new JRadioButton("Serdaigle");
|
||||
JRadioButton etiquette2 = new JRadioButton("Serpantard");
|
||||
JRadioButton etiquette3 = new JRadioButton("Poufsouffle");
|
||||
ButtonGroup btn = new ButtonGroup();
|
||||
btn.add(etiquette);
|
||||
btn.add(etiquette1);
|
||||
btn.add(etiquette2);
|
||||
btn.add(etiquette3);
|
||||
fenetre.add(etiquette);
|
||||
fenetre.add(etiquette1);
|
||||
fenetre.add(etiquette2);
|
||||
fenetre.add(etiquette3);
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Mise_page/Damier.class
Normal file
BIN
DEV2.1/Mise_page/Damier.class
Normal file
Binary file not shown.
23
DEV2.1/Mise_page/Damier.java
Normal file
23
DEV2.1/Mise_page/Damier.java
Normal file
@@ -0,0 +1,23 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
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]);
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 300);
|
||||
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);
|
||||
}
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user