File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY)
File f = filechooser.getFileSystemView().createFileObject( obj.toString()); if (filechooser.isTraversable(f) && filechooser.isDirectorySelectionEnabled())
    public void actionPerformed(ActionEvent e)    {      Object obj = filelist.getSelectedValue();      if (obj != null)        {	  File f = filechooser.getFileSystemView().createFileObject(obj	                                                            .toString());	  if (filechooser.isTraversable(f) &&               filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY)	    filechooser.setCurrentDirectory(f);	  else	    {	      filechooser.setSelectedFile(f);	      filechooser.approveSelection();	      closeDialog();	    }        }    }