Erreur java : JTabbedPane dans un JSplitPane
Résolu/Fermé
duchnoki
Messages postés
158
Date d'inscription
dimanche 12 octobre 2008
Statut
Membre
Dernière intervention
30 novembre 2010
-
3 mars 2010 à 16:53
duchnoki - 5 mars 2010 à 09:24
duchnoki - 5 mars 2010 à 09:24
A voir également:
- Erreur java : JTabbedPane dans un JSplitPane
- Erreur 1004 vba ✓ - Forum VB / VBA
- Jeux java itel ✓ - Forum Jeux vidéo
- Java runtime - Télécharger - Langages
- Java apk - Télécharger - Langages
- Erreur 1000 france tv - Forum MacOS
2 réponses
duchnoki
Messages postés
158
Date d'inscription
dimanche 12 octobre 2008
Statut
Membre
Dernière intervention
30 novembre 2010
4
3 mars 2010 à 17:00
3 mars 2010 à 17:00
P.S : Il faut savoir que mon JSplitPane est dans une autre classe :
WZMainSideBar sideBar = new WZMainSideBar();
WZMainWindowContent windowContent = new WZMainWindowContent();
JSplitPane content = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sideBar.getSideBar(), windowContent.getWindowContent());
content.setOneTouchExpandable(true);
content.setDividerLocation(200);
C'est bon : j'ai trouvé : Il faut créer un (en public) JPanel et mettre le JTabbedPane dedans (en public aussi) :
package wizzer.ui;
import java.awt.BorderLayout;
import javax.swing.*;
public class WZMainWindowContent {
public JPanel windowContent = new JPanel();
public JTabbedPane tabs = new JTabbedPane();
public WZMainWindowContent() {
windowContent.setLayout(new BorderLayout());
windowContent.add(tabs);
}
public void newFrame() {
tabs.addTab("[Sans titre]", new JPanel());
}
public JPanel getWindowContent() {
return windowContent;
}
}