if (chooser.showDialog(this, "Select file for export") == JFileChooser.APPROVE_OPTION) {
if (chooser.showDialog(this, Messages.getString("DocumentView.44")) == JFileChooser.APPROVE_OPTION) {
	private void export() throws XMLDBException {		String workDir = properties.getProperty("working-dir", System				.getProperty("user.dir"));		JFileChooser chooser = new JFileChooser(workDir);		chooser.setMultiSelectionEnabled(false);		chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);		chooser.setSelectedFile(new File(resource.getId())); 		if (chooser.showDialog(this, "Select file for export") == JFileChooser.APPROVE_OPTION) {			File file = chooser.getSelectedFile();			if (file.exists()					&& JOptionPane.showConfirmDialog(this,							"File exists. Overwrite?", "Overwrite?",							JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION)				return;			try {				OutputStreamWriter writer = new OutputStreamWriter(						new FileOutputStream(file), Charset.forName(properties								.getProperty("encoding")));				writer.write(text.getText());				writer.close();			} catch (IOException e) {				ClientFrame.showErrorMessage("XMLDBException: "						+ e.getMessage(), e);			}			File selectedDir = chooser.getCurrentDirectory();			properties					.setProperty("working-dir", selectedDir.getAbsolutePath());		}	}