@Override
	public void approveSelection() {
		File file = getSelectedFile();
		
		if (this.dialogType == JFileChooser.OPEN_DIALOG) {
			// Alert if file does not exist.
			if (!file.exists()) {
				String msg = GUITreeLoader.reg.getText("error_file_not_found");
				msg = Replace.replace(msg,GUITreeComponentRegistry.PLACEHOLDER_1, file.getPath());

				JOptionPane.showMessageDialog(this, msg);
				return;
			}
		} else if (this.dialogType == JFileChooser.SAVE_DIALOG) {
			// Alert if file exists.
			if (file.exists()) {
				// Custom button text
				String yes = GUITreeLoader.reg.getText("yes");
				String no = GUITreeLoader.reg.getText("no");
				String confirm_replacement = GUITreeLoader.reg.getText("confirm_replacement");
				String msg = GUITreeLoader.reg.getText("confirmation_replace_file");
				msg = Replace.replace(msg,GUITreeComponentRegistry.PLACEHOLDER_1, file.getPath());

				Object[] options = {yes, no};
				int result = JOptionPane.showOptionDialog(this,
					msg,
					confirm_replacement,
					JOptionPane.YES_NO_OPTION,
					JOptionPane.QUESTION_MESSAGE,
					null,
					options,
					options[1]
				);
				if (result == JOptionPane.YES_OPTION) {
					// Proceed normally.
				} else if (result == JOptionPane.NO_OPTION) {
					return;
				} else {
					return;
				}
			}
		}

		super.approveSelection();
	}