TitleInputDialog(Page page0) {

		super(JOptionPane.getFrameForComponent(page0), "Title", true);
		String s = Modeler.getInternationalText("Title");
		if (s != null)
			setTitle(s);

		page = page0;

		JPanel panel = new JPanel(new BorderLayout(8, 8));
		panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
		setContentPane(panel);

		final JTextField tf = new PastableTextField(page.getTitle(), 30);
		tf.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (!tf.getText().equals(page.getTitle())) {
					page.setTitle(tf.getText());
					page.saveReminder.setChanged(true);
				}
				dispose();
			}
		});
		panel.add(tf, BorderLayout.CENTER);

		s = Modeler.getInternationalText("TypeTitleForCurrentPage");
		String t = Modeler.getInternationalText("TypeBelowToChangeTitle");
		panel.add(new JLabel(tf.getText() == null || tf.getText().trim().equals("") ? (s != null ? s
				: "Please type a title for the current page")
				+ ":" : (t != null ? t : "To change the title, please type below") + ":"), BorderLayout.NORTH);

		JPanel p = new JPanel();
		s = Modeler.getInternationalText("OKButton");
		JButton button = new JButton(s != null ? s : " OK ");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (!tf.getText().equals(page.getTitle())) {
					page.setTitle(tf.getText());
					page.saveReminder.setChanged(true);
				}
				dispose();
			}
		});
		p.add(button);

		s = Modeler.getInternationalText("CancelButton");
		button = new JButton(s != null ? s : " Cancel ");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		p.add(button);

		panel.add(p, BorderLayout.SOUTH);

		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				dispose();
			}

			public void windowActivated(WindowEvent e) {
				tf.selectAll();
				tf.requestFocusInWindow();
			}
		});

		pack();
		setLocationRelativeTo(JOptionPane.getFrameForComponent(page));

	}