Java Swing - JButtons sur la Nouvelle Ligne

Je suis en train d'imprimer une liste générée de manière dynamique des boutons chaque bouton sur une nouvelle ligne.

public void addComponentToPane(Container pane) {
    JTabbedPane tabbedPane = new JTabbedPane();

    //Create the "cards".
    JPanel card1 = new JPanel() {

 JPanel card1 = new JPanel()     
 ... 

int n = 10;
JButton[] jButtons = new JButton[10];
for(int i=0; i<n; i++){
   jButtons[i] = new JButton("test" + i);
   card1.add(jButtons[i]);
   //card1.add("<br>");//<--this is wrong; but hopefully you get my point.
   jButtons[i].addActionListener(this);
}
InformationsquelleAutor John R | 2011-11-17