public void actionPerformed(ActionEvent e) {
JDialog about = new JDialog(parent, "About Bibkeeper", true);
JEditorPane jp = new JEditorPane();
JScrollPane sp = new JScrollPane(jp, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jp.setEditable(false);
try {
jp.setPage(GUIGlobals.aboutPage);
// We need a hyperlink listener to be able to switch to the license
// terms and back.
jp.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e) {
if (e.getEventType()
== javax.swing.event.HyperlinkEvent.EventType.ACTIVATED)
try {
((JEditorPane)e.getSource()).setPage(e.getURL());
} catch (IOException ex) {}
}
});
about.getContentPane().add(sp);
about.setSize(GUIGlobals.aboutSize);
Util.placeDialog(about, parent);
about.setVisible(true);
} catch (IOException ex) {
JOptionPane.showMessageDialog(parent, "Could not load file 'About.html'", "Error", JOptionPane.ERROR_MESSAGE);
}
}
|