ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/java/installer2/src/net/oni2/aeinstaller/gui/about/AboutDialog.java
Revision: 722
Committed: Thu Mar 21 11:41:22 2013 UTC (12 years, 7 months ago) by alloc
Content type: text/x-java
File size: 1557 byte(s)
Log Message:
Moved AEI2 to java folder

File Contents

# Content
1 package net.oni2.aeinstaller.gui.about;
2
3 import java.awt.event.ActionEvent;
4 import java.awt.event.KeyEvent;
5 import java.util.ResourceBundle;
6
7 import javax.swing.AbstractAction;
8 import javax.swing.JComponent;
9 import javax.swing.JDialog;
10 import javax.swing.JLabel;
11 import javax.swing.KeyStroke;
12
13 import net.oni2.aeinstaller.gui.HTMLLinkLabel;
14
15 import org.javabuilders.BuildResult;
16 import org.javabuilders.swing.SwingJavaBuilder;
17
18 /**
19 * @author Christian Illy
20 */
21 public class AboutDialog extends JDialog {
22 private static final long serialVersionUID = 1632257865019785612L;
23
24 private ResourceBundle bundle = ResourceBundle.getBundle(getClass()
25 .getName());
26 @SuppressWarnings("unused")
27 private BuildResult result = SwingJavaBuilder.build(this, bundle);
28
29 private JLabel lblAppversion;
30 private HTMLLinkLabel txtLinks;
31
32 /**
33 * Open the dialog
34 */
35 public AboutDialog() {
36 lblAppversion.setText("v"
37 + SwingJavaBuilder.getConfig().getResource("appversion"));
38
39 txtLinks.setText(bundle.getString("Links"));
40
41 pack();
42
43 AbstractAction closeAction = new AbstractAction() {
44
45 private static final long serialVersionUID = 1L;
46
47 public void actionPerformed(ActionEvent arg0) {
48 dispose();
49 }
50 };
51 KeyStroke ksCtrlW = KeyStroke
52 .getKeyStroke('W', KeyEvent.CTRL_DOWN_MASK);
53 getRootPane()
54 .getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
55 .put(ksCtrlW, "close");
56 getRootPane().getActionMap().put("close", closeAction);
57
58 setLocationRelativeTo(null);
59 }
60
61 }