bonjour,
j'ai une applet java et j'aimerai y inserer un JToolbar.
voici ma classe principale :
BarFormat est une classe hertie de JToolBar
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public class Principale extends JApplet { BarFormat bar_format; JPanel panel_bar; BorderLayout layout; public void init() { layout = new BorderLayout(); this.getContentPane().setLayout(layout); panel_bar = new JPanel(); bar_format = new BarFormat(); panel_bar.add(bar_format); this.getContentPane().add("North", panel_bar); } public void paint (Graphics g) { } }
ell cree un JToolBar avec deja tout les bouton dedans
la voici :
je ne vois pas ou est mon erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 public class BarFormat extends JToolBar { public JButton cmd_ita; public BarFormat() { cmd_ita = new JButton("i"); this.add(cmd_ita); } }
merci pour votre aide 8)
Partager