Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionclass EcouteurOuvrir implements ActionListener { VueProjet vp; JFileChooser choixfichier; EcouteurOuvrir(VueProjet vp) { this.vp = vp; choixfichier = new JFileChooser("."); choixfichier.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } public void actionPerformed(ActionEvent e) { int i = choixfichier.showOpenDialog(vp); if(i == JFileChooser.APPROVE_OPTION) { File file = choixfichier.getSelectedFile(); if(vp.onglets.getTabCount() == 0) { vp.fermer.setEnabled(true); } Onglet np = new Onglet(file); vp.onglets.add(file.getName(),np); } } }
class Onglet extends JSplitPane { JSplitPane sp; JTabbedPane gauche; JScrollPane droit; public Onglet(File file) { Explorateur ex = new Explorateur(file); //Recherche re = new Recherche(); JEditorPane page = new JEditorPane(); gauche = new JTabbedPane(); droit = new JScrollPane(); sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); sp.removeAll(); gauche.add(ex); //gauche.add(re); droit.add(page); sp.add(gauche,JSplitPane.LEFT); sp.add(droit,JSplitPane.RIGHT); } }