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
.setText(resourceMap
.getString("Application.title")); // NOI18N
53 appTitleLabel
.setName("appTitleLabel"); // NOI18N
55 versionLabel
.setFont(versionLabel
.getFont().deriveFont(versionLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
56 versionLabel
.setText(resourceMap
.getString("versionLabel.text")); // NOI18N
57 versionLabel
.setName("versionLabel"); // NOI18N
59 appVersionLabel
.setText(resourceMap
.getString("Application.version")); // NOI18N
60 appVersionLabel
.setName("appVersionLabel"); // NOI18N
62 vendorLabel
.setFont(vendorLabel
.getFont().deriveFont(vendorLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
63 vendorLabel
.setText(resourceMap
.getString("vendorLabel.text")); // NOI18N
64 vendorLabel
.setName("vendorLabel"); // NOI18N
66 appVendorLabel
.setText(resourceMap
.getString("Application.vendor")); // NOI18N
67 appVendorLabel
.setName("appVendorLabel"); // NOI18N
69 homepageLabel
.setFont(homepageLabel
.getFont().deriveFont(homepageLabel
.getFont().getStyle() | java
.awt
.Font
.BOLD
));
70 homepageLabel
.setText(resourceMap
.getString("homepageLabel.text")); // NOI18N
71 homepageLabel
.setName("homepageLabel"); // NOI18N
73 appHomepageLabel
.setText(resourceMap
.getString("Application.homepage")); // NOI18N
74 appHomepageLabel
.setName("appHomepageLabel"); // NOI18N
76 appDescLabel
.setText(resourceMap
.getString("appDescLabel.text")); // NOI18N
77 appDescLabel
.setName("appDescLabel"); // NOI18N
79 imageLabel
.setIcon(resourceMap
.getIcon("imageLabel.icon")); // NOI18N
80 imageLabel
.setName("imageLabel"); // NOI18N
82 javax
.swing
.GroupLayout layout
= new javax
.swing
.GroupLayout(getContentPane());
83 getContentPane().setLayout(layout
);
84 layout
.setHorizontalGroup(
85 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
86 .addGroup(layout
.createSequentialGroup()
87 .addComponent(imageLabel
)
89 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.TRAILING
)
90 .addGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
, layout
.createSequentialGroup()
91 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
92 .addComponent(versionLabel
)
93 .addComponent(vendorLabel
)
94 .addComponent(homepageLabel
))
95 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
96 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
97 .addComponent(appVersionLabel
)
98 .addComponent(appVendorLabel
)
99 .addComponent(appHomepageLabel
)))
100 .addComponent(appTitleLabel
, javax
.swing
.GroupLayout
.Alignment
.LEADING
)
101 .addComponent(appDescLabel
, javax
.swing
.GroupLayout
.Alignment
.LEADING
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, 266, Short
.MAX_VALUE
)
102 .addComponent(closeButton
))
105 layout
.setVerticalGroup(
106 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
107 .addComponent(imageLabel
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
)
108 .addGroup(layout
.createSequentialGroup()
110 .addComponent(appTitleLabel
)
111 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
112 .addComponent(appDescLabel
)
113 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
114 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
115 .addComponent(versionLabel
)
116 .addComponent(appVersionLabel
))
117 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
118 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
119 .addComponent(vendorLabel
)
120 .addComponent(appVendorLabel
))
121 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
122 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
123 .addComponent(homepageLabel
)
124 .addComponent(appHomepageLabel
))
125 .addGap(19, 19, Short
.MAX_VALUE
)
126 .addComponent(closeButton
)
131 }// </editor-fold>//GEN-END:initComponents
133 // Variables declaration - do not modify//GEN-BEGIN:variables
134 private javax
.swing
.JButton closeButton
;
135 // End of variables declaration//GEN-END:variables