salut a tous,
je ne sais pas c'est quoi mon probleme avec les JScrollPane, mais encore une fois, pas de scrollbars.
voici mon code (pret a l'execution):qq aurait une idee?
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 import javax.swing.*; import java.awt.*; public class Box1 extends JFrame{ JPanel panel1=new JPanel(),panel2; public Box1(){ panel2=new JPanel(new GridLayout(25,1)); add(panel1); panel1.add(new JScrollPane(panel2)); for (int i=0;i<22;i++){ panel2.add(new JButton("boutton")); } this.setSize(400,440); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } public static void main(String[] aer){ new Box1(); } }
merci d'avance.
Partager