Ver código fonte

Ajout panneau rouge et bouton

Laurent HUBERT 4 anos atrás
pai
commit
d92cacd9c1

+ 8 - 2
InterfacesGraphiques/src/formation/java/gui/panel/DemonstrationFenetre.java

@@ -1,6 +1,8 @@
 package formation.java.gui.panel;
 
+import java.awt.Color;
 import java.awt.Container;
+import java.awt.Dimension;
 
 import javax.swing.JButton;
 import javax.swing.JFrame;
@@ -18,10 +20,14 @@ public class DemonstrationFenetre {
 		JPanel panel = new JPanel();
 		
 		panneauPrincipal.add(panel);
-		panel.add(monBouton);
 		
+		JPanel rouge = new JPanel();
+		rouge.setBackground(Color.red);
+		rouge.setPreferredSize(new Dimension(30, 20));
 		
-		fenetre.setVisible(true);
+		panel.add(monBouton);
+		panel.add(rouge);
 		
+		fenetre.setVisible(true);
 	}
 }