File selectedDir = chooser.getCurrentDirectory(); properties.setProperty("working-dir", selectedDir.getAbsolutePath());
	private void save() {		JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));		chooser.setMultiSelectionEnabled(false);		chooser.setFileSelectionMode(JFileChooser.FILES_ONLY + JFileChooser.SAVE_DIALOG);		if (chooser.showDialog(this, "Select file for query export")			== JFileChooser.APPROVE_OPTION) {			File file = chooser.getSelectedFile();			if(file.exists() && (!file.canWrite()))				JOptionPane.showMessageDialog(this, "Can not write query to file " + file.getAbsolutePath(),						"Error", JOptionPane.ERROR_MESSAGE);			if(file.exists() &&				JOptionPane.showConfirmDialog(this, "File exists. Overwrite?", "Overwrite?", 					JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION)				return;			try {				FileWriter writer = new FileWriter(file);				writer.write(query.getText());				writer.close();			} catch (FileNotFoundException e) {				ClientFrame.showErrorMessage(e.getMessage(), e);			} catch (IOException e) {				ClientFrame.showErrorMessage(e.getMessage(), e);			}		}	}