SoundInputDialog(Page page0) {

		super(JOptionPane.getFrameForComponent(page0), "Background Sound", true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		String s = Modeler.getInternationalText("BackgroundSound");
		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);

		clipNameComboBox = new JComboBox();
		fillClipNameComboBox();
		panel.add(clipNameComboBox, BorderLayout.CENTER);

		s = Modeler.getInternationalText("SelectBackgroundSoundForCurrentPage");
		panel.add(new JLabel(s != null ? s : "Set the background sound for the current page:"), BorderLayout.NORTH);

		JPanel p = new JPanel();

		s = Modeler.getInternationalText("LoopBackgroundSound");
		loopCheckBox = new JCheckBox(s != null ? s : "Loop");
		loopCheckBox.setSelected(page.getLoopBackgroundSound());
		p.add(loopCheckBox);

		s = Modeler.getInternationalText("OKButton");
		JButton button = new JButton(s != null ? s : "OK");
		if (clipNameComboBox.getItemCount() > 0) {
			button.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					if ("None".equals(clipNameComboBox.getSelectedItem())) {
						page.setBackgroundSound(null);
					}
					else {
						page.setBackgroundSound((String) clipNameComboBox.getSelectedItem());
						page.setLoopBackgroundSound(loopCheckBox.isSelected());
					}
					page.saveReminder.setChanged(true);
					dispose();
				}
			});
		}
		else {
			button.setEnabled(false);
		}
		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) {
				clipNameComboBox.requestFocusInWindow();
			}
		});

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

	}