private String popFileChooser() { final BuFileChooser chooser = new CtuluFileChooser(false); if (filtre_ != null) { chooser.setFileFilter(filtre_); } if (dirOpen_ == null) { dirOpen_ = System.getProperty("user.dir") + File.separator + "exemples"; } if (dirOpen_ != null) { chooser.setCurrentDirectory(new File(dirOpen_)); } final int returnVal = chooser.showOpenDialog(this); dirOpen_ = chooser.getCurrentDirectory().getAbsolutePath(); String filename = null; if (returnVal == JFileChooser.APPROVE_OPTION) { filename = chooser.getSelectedFile().getAbsolutePath(); } return filename; } }
chooser.setFileFilter(filtre_);
public synchronized void ouvrir() { Frame parent = null; if (appli_ instanceof Frame) { parent = (Frame) appli_; } final BuFileChooser chooser = new CtuluFileChooser(true); chooser.setFileFilter(filtre_); // if (dirOpen_ == null) // dirOpen_= System.getProperty("user.dir") + File.separator + "exemples"; // if (dirOpen_ != null) // chooser.setCurrentDirectory(new File(dirOpen_)); final int returnVal = chooser.showOpenDialog(parent); String filename = null; if (returnVal == JFileChooser.APPROVE_OPTION) { filename = chooser.getSelectedFile().getAbsolutePath(); if ((filename != null)) { // dirOpen_= new File(filename).getAbsolutePath(); // dirOpen_= // dirOpen_.substring(0, dirOpen_.lastIndexOf(File.separatorChar)); actualiseMenu(IN_DISABLE, OUT_ENABLE); ouvre(filename); fireStatusChanged(new FudaaProjetEvent(this, FudaaProjetEvent.PROJECT_OPENED)); } } }
chooser.setFileFilter(DjaLoadSaveLib.get(EXTENSIONS[0]).getFilter());
chooser.setFileFilter(DjaLoadSaveLib.get(EXTENSIONS[0]).getFilter());