public GraphDialog(Graph2D g) {

		super();
		setModal(true);
		setSize(200, 200);
		String s = XYGrapher.getInternationalText("GraphSettings");
		setTitle(s != null ? s : "Graph Settings");

		graph2D = g;

		JTabbedPane tabbedPane = new JTabbedPane();
		getContentPane().add(tabbedPane, BorderLayout.CENTER);

		/* legend options */
		JPanel panel = new JPanel(new BorderLayout());

		legendFontChooser = new FontChooser();
		legendFontChooser.enableUnderline(false);
		legendFontChooser.enableStrikethrough(false);
		legendFontChooser.enableSubscript(false);
		legendFontChooser.enableSuperscript(false);
		legendFontChooser.enableFontColor(false);
		panel.add(legendFontChooser, BorderLayout.CENTER);

		JPanel p = new JPanel(new GridLayout(1, 4, 5, 5));

		JLabel label = new JLabel("  X (in pixels)");
		p.add(label);

		tfx = new JTextField();
		try {
			tfx.setText(Integer.toString(graph2D.getLegendLocation().x));
		}
		catch (NullPointerException e) {
			tfx.setText("Not set");
		}
		p.add(tfx);

		label = new JLabel(" Y (in pixels)");
		p.add(label);

		tfy = new JTextField();
		try {
			tfy.setText(Integer.toString(graph2D.getLegendLocation().y));
		}
		catch (NullPointerException e) {
			tfy.setText("Not set");
		}
		p.add(tfy);

		panel.add(p, BorderLayout.SOUTH);

		s = XYGrapher.getInternationalText("Legend");
		tabbedPane.addTab(s != null ? s : "Legends", panel);

		/* label options */
		panel = new JPanel(new BorderLayout());

		labelFontChooser = new FontChooser();
		labelFontChooser.enableUnderline(false);
		labelFontChooser.enableStrikethrough(false);
		labelFontChooser.enableSubscript(false);
		labelFontChooser.enableSuperscript(false);
		labelFontChooser.enableFontColor(false);
		panel.add(labelFontChooser, BorderLayout.NORTH);

		s = XYGrapher.getInternationalText("AxisLabel");
		tabbedPane.addTab(s != null ? s : "Axis Labels", panel);

		/* button panel */
		panel = new JPanel();

		s = XYGrapher.getInternationalText("OK");
		JButton b = new JButton(s != null ? s : "OK");
		b.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				confirm();
				graph2D.repaint();
				dispose();
			}
		});
		panel.add(b);

		s = XYGrapher.getInternationalText("Cancel");
		b = new JButton(s != null ? s : "Cancel");
		b.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		panel.add(b);

		getContentPane().add(panel, BorderLayout.SOUTH);

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

	}