// URL u = MainFrame.class.getClassLoader().getResource("com/googlecode/javacv/procamtracker");
// JarURLConnection c = (JarURLConnection)u.openConnection();
// timestamp = c.getManifest().getMainAttributes().getValue("Time-Stamp");
// } catch (Exception e) { }
JTextPane textPane = new JTextPane();
textPane.setEditable(false);
textPane.setContentType("text/html");
textPane.setText(
"<font face=sans-serif><strong><font size=+2>ProCamTracker</font></strong><br>" +
"build timestamp " + timestamp + "<br>" +
"Copyright (C) 2009,2010,2011 Samuel Audet <<a href=\"mailto:saudet@ok.ctrl.titech.ac.jp%28Samuel%20Audet%29\">saudet@ok.ctrl.titech.ac.jp</a>><br>" +
"Web site: <a href=\"http://www.ok.ctrl.titech.ac.jp/~saudet/procamtracker/\">http://www.ok.ctrl.titech.ac.jp/~saudet/procamtracker/</a><br>" +
"<br>" +
"Licensed under the GNU General Public License version 2 (GPLv2).<br>" +
"Please refer to LICENSE.txt or <a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a> for details."
);
textPane.setCaretPosition(0);
Dimension dim = textPane.getPreferredSize();
dim.height = dim.width*3/4;
textPane.setPreferredSize(dim);
textPane.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if(e.getEventType() == EventType.ACTIVATED) {
try {
Desktop.getDesktop().browse(e.getURL().toURI());
} catch(Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,
"Could not launch browser to \"" + e.getURL()+ "\"", ex);
}
}
}
});
// pass the scrollpane to the joptionpane.
JDialog dialog = new JOptionPane(textPane, JOptionPane.PLAIN_MESSAGE).
createDialog(this, "About");
if (UIManager.getLookAndFeel().getClass().getName()
.equals("com.sun.java.swing.plaf.gtk.GTKLookAndFeel")) {
// under GTK, frameBackground is white, but rootPane color is OK...
// but under Windows, the rootPane's color is funny...
Color c = dialog.getRootPane().getBackground();
textPane.setBackground(new Color(c.getRGB()));
} else {
Color frameBackground = this.getBackground();
textPane.setBackground(frameBackground);
}
dialog.setVisible(true);
}//GEN-LAST:event_aboutMenuItemActionPerformed