AboutWindow.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 package org.gecode.explorer.swing;
00025
00026 import java.awt.*;
00027 import java.awt.event.*;
00028 import javax.swing.*;
00029 import javax.swing.event.*;
00030
00031 class AboutWindow extends JDialog implements HyperlinkListener {
00032 public AboutWindow(Frame owner) {
00033 super(owner, "About the Gecode/J Explorer");
00034 setVisible(false);
00035
00036 String text =
00037 "<HEAD></HEAD><BODY>"+
00038 "<H1 align='center'>The Gecode/J Explorer</H1>"+
00039 "<P align='center'>© 2005,2006 The Gecode Team</P>"+
00040 "<P align='center'><A HREF='/'>"+
00041 "http://www.gecode.org</A></P>"+
00042 "</BODY>";
00043
00044 JEditorPane ep = new JEditorPane("text/html", text);
00045 ep.setBackground(owner.getBackground());
00046 ep.setEditable(false);
00047 ep.addHyperlinkListener(this);
00048 getContentPane().add(ep);
00049 pack();
00050 setResizable(false);
00051 }
00052 public void open() {
00053 setVisible(true);
00054 }
00055
00056
00057 public void hyperlinkUpdate(HyperlinkEvent e) {
00058 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
00059 try {
00060 BareBonesBrowserLaunch.openURL("http://www.gecode.org");
00061 } catch (Exception t) {}
00062 }
00063 }
00064
00065 }