private JButton createButton(String buttonCaption) {
		final JButton button = new JButton(buttonCaption);
		button.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				JFileChooser fc = new JFileChooser();
				fc.setSelectedFile(file);
				int selection;
				switch (type) {
				case OPEN:
					selection = fc.showOpenDialog(button);
					break;
				case SAVE:
					selection = fc.showSaveDialog(button);
					break;
				default:
					// Compiler requires this line of dead code
					throw new RuntimeException();
				}
				if (selection == JFileChooser.APPROVE_OPTION) {
					update(fc.getSelectedFile());
				}
			}
		});
		return button;
	}