source: java/installer2/src/net/oni2/aeinstaller/gui/about/AboutDialog.java@ 857

Last change on this file since 857 was 849, checked in by alloc, 12 years ago

AEI2.08:

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