private void saveProblem() {
		fileChooser.setDialogTitle("Save Problem File");
		fileChooser.setMultiSelectionEnabled(false);
		fileChooser.setFileFilter(new FileNameExtensionFilter("PDDL Files",
				"pddl"));
		fileChooser.setSelectedFile(new File(problemNameField.getText()
				+ ".pddl"));
		int returnValue = fileChooser.showSaveDialog(this);
		if (returnValue == JFileChooser.APPROVE_OPTION) {
			File selectedFile = fileChooser.getSelectedFile();
			if (selectedFile.exists()) {
				int option = JOptionPane
						.showConfirmDialog(this,
								"Are you sure you would like to overwrite "
										+ selectedFile.getName(),
								"File Exists!", JOptionPane.YES_NO_OPTION,
								JOptionPane.QUESTION_MESSAGE);
				if (option == JOptionPane.NO_OPTION) {
					return;
				}
			} else if (selectedFile.getName().lastIndexOf('.') == -1) {
				selectedFile = new File(selectedFile + ".pddl");
			}
			try {
				controller.save(selectedFile);
			} catch (IOException e) {
				JOptionPane.showMessageDialog(this, "Error opening "
						+ selectedFile.getName() + " for writing",
						"PDDL Write Error", JOptionPane.ERROR_MESSAGE);
			} catch (PDDLModelIncompleteException e) {
				JOptionPane.showMessageDialog(this, "Error: " + e.getMessage(),
						"PDDL Write Error", JOptionPane.ERROR_MESSAGE);
			}
		}
	}