2 * GravitySimulatorAboutBox.java
5 package edu
.mit
.ezyang
.gravity
;
7 import org
.jdesktop
.application
.Action
;
9 public class GravitySimulatorAboutBox
extends javax
.swing
.JDialog
{
11 public GravitySimulatorAboutBox(java
.awt
.Frame parent
) {
14 getRootPane().setDefaultButton(closeButton
);
17 @Action public void closeAboutBox() {
21 /** This method is called from within the constructor to
22 * initialize the form.
23 * WARNING: Do NOT modify this code. The content of this method is
24 * always regenerated by the Form Editor.
26 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
27 private void initComponents() {
29 closeButton
= new javax
.swing
.JButton();
30 javax
.swing
.JLabel appTitleLabel
= new javax
.swing
.JLabel();
31 javax
.swing
.JLabel versionLabel
= new javax
.swing
.JLabel();
32 javax
.swing
.JLabel appVersionLabel
= new javax
.swing
.JLabel();
33 javax
.swing
.JLabel vendorLabel
= new javax
.swing
.JLabel();
34 javax
.swing
.JLabel appVendorLabel
= new javax
.swing
.JLabel();
35 javax
.swing
.JLabel homepageLabel
= new javax
.swing
.JLabel();
36 javax
.swing
.JLabel appHomepageLabel
= new javax
.swing
.JLabel();
37 javax
.swing
.JLabel appDescLabel
= new javax
.swing
.JLabel();
38 javax
.swing
.JLabel imageLabel
= new javax
.swing
.JLabel();
40 setDefaultCloseOperation(javax
.swing
.WindowConstants
.DISPOSE_ON_CLOSE
);
41 org
.jdesktop
.application
.ResourceMap resourceMap
= org
.jdesktop
.application
.Application
.getInstance(edu
.mit
.ezyang
.gravity
.GravitySimulatorApp
.class).getContext().getResourceMap(GravitySimulatorAboutBox
.class);
42 setTitle(resourceMap
.getString("title")); // NOI18N
44 setName("aboutBox"); // NOI18N
47 javax
.swing
.ActionMap actionMap
= org
.jdesktop
.application
.Application
.getInstance(edu
.mit
.ezyang
.gravity
.GravitySimulatorApp
.class).getContext().getActionMap(GravitySimulatorAboutBox
.class, this);
48 closeButton
.setAction(actionMap
.get("closeAboutBox")); // NOI18N
49 closeButton
.setName("closeButton"); // NOI18N
51 appTitleLabel
.setFont(appTitleLabel
.getFont().deriveFont(appTitleLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
, appTitleLabel
.getFont().getSize()+4));
52 appTitleLabel
.setName("appTitleLabel"); // NOI18N
54 versionLabel
.setFont(versionLabel
.getFont().deriveFont(versionLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
55 versionLabel
.setText(resourceMap
.getString("versionLabel.text")); // NOI18N
56 versionLabel
.setName("versionLabel"); // NOI18N
58 appVersionLabel
.setName("appVersionLabel"); // NOI18N
60 vendorLabel
.setFont(vendorLabel
.getFont().deriveFont(vendorLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
61 vendorLabel
.setText(resourceMap
.getString("vendorLabel.text")); // NOI18N
62 vendorLabel
.setName("vendorLabel"); // NOI18N
64 appVendorLabel
.setName("appVendorLabel"); // NOI18N
66 homepageLabel
.setFont(homepageLabel
.getFont().deriveFont(homepageLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
67 homepageLabel
.setText(resourceMap
.getString("homepageLabel.text")); // NOI18N
68 homepageLabel
.setName("homepageLabel"); // NOI18N
70 appHomepageLabel
.setName("appHomepageLabel"); // NOI18N
72 appDescLabel
.setText(resourceMap
.getString("appDescLabel.text")); // NOI18N
73 appDescLabel
.setName("appDescLabel"); // NOI18N
75 imageLabel
.setIcon(resourceMap
.getIcon("imageLabel.icon")); // NOI18N
76 imageLabel
.setName("imageLabel"); // NOI18N
78 javax
.swing
.GroupLayout layout
= new javax
.swing
.GroupLayout(getContentPane());
79 getContentPane().setLayout(layout
);
80 layout
.setHorizontalGroup(
81 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
82 .addGroup(layout
.createSequentialGroup()
83 .addComponent(imageLabel
)
85 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.TRAILING
)
86 .addGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
, layout
.createSequentialGroup()
87 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
88 .addComponent(versionLabel
)
89 .addComponent(vendorLabel
)
90 .addComponent(homepageLabel
))
91 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
92 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
93 .addComponent(appVersionLabel
)
94 .addComponent(appVendorLabel
)
95 .addComponent(appHomepageLabel
)))
96 .addComponent(appTitleLabel
, javax
.swing
.GroupLayout
.Alignment
.LEADING
)
97 .addComponent(appDescLabel
, javax
.swing
.GroupLayout
.Alignment
.LEADING
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, 266, Short
.MAX_VALUE
)
98 .addComponent(closeButton
))
101 layout
.setVerticalGroup(
102 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
103 .addComponent(imageLabel
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
)
104 .addGroup(layout
.createSequentialGroup()
106 .addComponent(appTitleLabel
)
107 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
108 .addComponent(appDescLabel
)
109 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
110 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
111 .addComponent(versionLabel
)
112 .addComponent(appVersionLabel
))
113 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
114 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
115 .addComponent(vendorLabel
)
116 .addComponent(appVendorLabel
))
117 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
118 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
119 .addComponent(homepageLabel
)
120 .addComponent(appHomepageLabel
))
121 .addGap(33, 33, Short
.MAX_VALUE
)
122 .addComponent(closeButton
)
127 }// </editor-fold>//GEN-END:initComponents
129 // Variables declaration - do not modify//GEN-BEGIN:variables
130 private javax
.swing
.JButton closeButton
;
131 // End of variables declaration//GEN-END:variables