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

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

AEI2.08:

File size: 1.7 KB
RevLine 
[593]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
[840]13import net.oni2.resourcebundle.UTF8ResourceBundleLoader;
[849]14import net.oni2.swingcomponents.HTMLLinkLabel;
[593]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
[840]25 private ResourceBundle bundle = UTF8ResourceBundleLoader.getBundle(getClass()
[593]26 .getName());
27 @SuppressWarnings("unused")
28 private BuildResult result = SwingJavaBuilder.build(this, bundle);
29
[772]30 private JLabel lblAppname;
[593]31 private HTMLLinkLabel txtLinks;
[755]32 private HTMLLinkLabel lblAE;
[593]33
34 /**
35 * Open the dialog
36 */
37 public AboutDialog() {
[772]38 lblAppname.setText(SwingJavaBuilder.getConfig().getResource("appname")
[593]39 + SwingJavaBuilder.getConfig().getResource("appversion"));
40
41 txtLinks.setText(bundle.getString("Links"));
[755]42 lblAE.setText(bundle.getString("ae"));
[593]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);
[641]60
61 setLocationRelativeTo(null);
[593]62 }
63
64}
Note: See TracBrowser for help on using the repository browser.