private void saveSession() {
    JFileChooser ch = new JFileChooser();
    ch.setCurrentDirectory(new File(Data.settings.defaultDir));
    ch.setDialogTitle(Data.text("session-save"));
    ch.setAcceptAllFileFilterUsed(false);
    ch.addChoosableFileFilter(FileFilters.session);
    ch.setSelectedFile(new File(Data.settings.defaultDir, "session"));

    if (ch.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file;

      if (ch.getSelectedFile().getAbsolutePath().endsWith(".xml")) {
        file = new File(ch.getSelectedFile().getAbsolutePath());
      } else {
        file = new File(ch.getSelectedFile().getAbsolutePath() + ".xml");
      }

      //System.out.println(file);
      if (!file.exists()) {
        try {
          file = new File(file.getAbsoluteFile() + "");
          file.createNewFile();
          //boolean result = SaveSession(file);
          boolean result = saveSessionFile(file);
          if (result) {
            JOptionPane.showMessageDialog(rootPane, Data.text("session-save-success"), Data.text("session-save"), JOptionPane.INFORMATION_MESSAGE);
          }
        } catch (IOException ex) {
          JOptionPane.showMessageDialog(rootPane, Data.text("error") + ": " + ex.toString());
          error(null, ex);
        }
      } else {
        int dialog = JOptionPane.showConfirmDialog(rootPane, Data.text("session-save-exist"));
        if (dialog == 0) {
          boolean result = saveSessionFile(file);
          if (result) {
            JOptionPane.showMessageDialog(rootPane, Data.text("session-save-success"));
          }
        }
      }
    }
  }