JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(parent); if(returnVal == JFileChooser.APPROVE_OPTION) { //Ce qui t'intéresse (enfin normalement) System.out.println("You chose to open this file: " + chooser.getSelectedFile().getAbsolutePath()); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionJTextField field = new JTexteField(); .... JFileChooser chooser = new JFileChooser(); ... field.setText(chooser.getSelectedFile().getAbsolutePath());