
import java.io.*;
import java.net.URL;
import java.net.MalformedURLException;
import javax.swing.*;
import javax.swing.event.*;

public class HelpWin extends JFrame {
	public HelpWin(URL url) {
		super(CDcreator.i18n("titleHelpWin"));
		setBounds(200, 200, 600, 400);
		setContentPane(new HtmlPane(url));
	}
}

class HtmlPane
	extends JScrollPane
	implements HyperlinkListener {
	JEditorPane html;

	public HtmlPane(URL url) {
		try {
			html = new JEditorPane(url);
			html.setEditable(false);
			html.addHyperlinkListener(this);

			JViewport vp = getViewport();
			vp.add(html);
		} catch (IOException e) {
			System.out.println("IOException: " + e);
		}
	}

	/**
	 *
	 */
	public void hyperlinkUpdate(HyperlinkEvent e) {
		if (e.getEventType()
			== HyperlinkEvent.EventType.ACTIVATED) {
			try {
				System.out.println(e.getURL());
				html.setPage(e.getURL());
			}
			catch (IOException e2) {
				System.out.println("IOException: " + e2);
			}
		}
	}
}
