else { File f = new File(filechooser.getCurrentDirectory(), getFileName()); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } }
    public void actionPerformed(ActionEvent e)    {      Object obj = null;      if (parentPath != null)        obj = new String(parentPath + getFileName());      else        obj = filechooser.getSelectedFile();      if (obj != null)        {          File f = filechooser.getFileSystemView().createFileObject(obj.toString());          File currSelected = filechooser.getSelectedFile();          if (filechooser.isTraversable(f))            {              filechooser.setCurrentDirectory(currSelected);              filechooser.rescanCurrentDirectory();            }          else            {              filechooser.approveSelection();              closeDialog();            }        }    }