insérer un petit formulaire sur le panel qui contient une image de fond
Bonjour,
je veux insérer un JLABEL et un bouton contenus dans mon panel4 sur mon panel panel2 qui contient une image de fond mais j'y arrive pas ,
voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
JFrame frame = new JFrame("Exemple");
Toolkit tk = Toolkit.getDefaultToolkit();
Image fond = tk.getImage("res2.jpg");
FenetreFond fenFond = new FenetreFond(fond);
JPanel panel2 = new JPanel(new BorderLayout());
JPanel panel4 = new JPanel();
panel2.add(fenFond, BorderLayout.CENTER);
JPanel panel3 = new JPanel(new BorderLayout());
panel3.add(panel2, BorderLayout.CENTER);
panel4.add(jPanel1, BorderLayout.CENTER);
panel2.add(panel4,BorderLayout.PAGE_END);
panel3.add(jPanel2, BorderLayout.SOUTH);
frame.add(panel3);
frame.setSize(700, 575);
frame.setLocation(280, 200);
frame.show(); |