public File chooseGrammarDialog(final File cur) {
    File dir = cur;
    if(dir == null || !dir.exists()) {
      dir = INI.getObject("last", "grammarDir", Converter.FILE_CONVERTER, HOME_STR);
    }
    final JFileChooser choose = new JFileChooser(dir);
    choose.setMultiSelectionEnabled(false);
    choose.setFileSelectionMode(JFileChooser.FILES_ONLY);
    final boolean approved = choose.showOpenDialog(this) == JFileChooser.APPROVE_OPTION;
    final File res = approved ? choose.getSelectedFile() : null;
    if(res != null) {
      INI.setObject("last", "grammarDir", res.getParentFile());
    }
    return res;
  }