if (result == APPROVE_OPTION) { if (getFileFilter() instanceof ExtensionFileFilter) { String filename = getSelectedFile().getAbsolutePath(); String[] extensions = ((ExtensionFileFilter) getFileFilter()).getExtensions(); if (!filename.endsWith(extensions[0])) { filename += extensions[0]; setSelectedFile(new File(filename)); } } }
  public int showOpenDialog(Component parent) {    m_DialogType       = LOADER_DIALOG;    m_CurrentConverter = null;        initGUI(LOADER_DIALOG);        int result = super.showOpenDialog(parent);        m_DialogType = UNHANDLED_DIALOG;    removePropertyChangeListener(m_Listener);        // does file exist?    if (    (result == APPROVE_OPTION) 	 && (getFileMustExist()) 	 && (!getSelectedFile().exists()) ) {      int retVal = JOptionPane.showConfirmDialog(	  parent, 	  "The file '" 	  + getSelectedFile() 	  + "' does not exist - please select again!");      if (retVal == JOptionPane.OK_OPTION)	result = showOpenDialog(parent);      else	result = CANCEL_OPTION;    }    if (result == APPROVE_OPTION) {      m_LastFilter = getFileFilter();      configureCurrentConverter(LOADER_DIALOG);    }        return result;  }