jTracer  1.03
Stack trace visualization tool
AboutDialog.java
Go to the documentation of this file.
1 
7 package org.libcsdbg.jtracer.installer;
8 
9 import java.io.File;
10 
11 import java.awt.Insets;
12 import java.awt.Dimension;
13 import java.awt.BorderLayout;
14 
15 import javax.swing.event.HyperlinkListener;
16 import javax.swing.WindowConstants;
17 import javax.swing.JDialog;
18 import javax.swing.JFrame;
19 import javax.swing.JEditorPane;
20 
27 public class AboutDialog extends JDialog
28 {
30  private static final long serialVersionUID = 0x00;
31 
32 
38  AboutDialog(JFrame owner)
39  {
40  super(owner, true);
41  Registry conf = Registry.getCurrent();
42  setTitle("About " + (String) conf.get("generic", "name"));
43 
44  try {
45  File page = conf.getResource("var/about.html");
46  JEditorPane viewer = new JEditorPane(page.toURI().toURL());
47 
48  viewer.putClientProperty(JEditorPane.W3C_LENGTH_UNITS, true);
49  viewer.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true);
50  viewer.setEditable(false);
51  viewer.setFocusable(false);
52  viewer.setMargin(new Insets(0, 0, 0, 0));
53  viewer.setPreferredSize(new Dimension(450, 340));
54  viewer.addHyperlinkListener((HyperlinkListener) owner);
55  add(viewer, BorderLayout.CENTER);
56  }
57 
58  catch (Throwable t) {
59  Registry.debug(t);
60  dispose();
61  return;
62  }
63 
64  setResizable(false);
65  setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
66  pack();
67  }
68 }
69 
Object get(String section, String key)
Get an entry.
Definition: Registry.java:106
A dialog that shows an HTML page with project information (version, short description, license, copyright e.t.c) and links to various online project resources.
static final long serialVersionUID
Class version.