1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 package com.buckosoft.fibs.BuckoFIBS.gui;
39
40 import java.awt.Dialog;
41 import java.awt.Font;
42 import java.awt.Frame;
43 import java.awt.GridBagConstraints;
44 import java.awt.GridBagLayout;
45 import java.awt.Insets;
46 import java.io.IOException;
47
48 import javax.swing.JDialog;
49 import javax.swing.JEditorPane;
50 import javax.swing.JLabel;
51 import javax.swing.JPanel;
52 import javax.swing.JScrollPane;
53
54
55
56
57
58
59
60 public class AboutDialog extends JDialog {
61
62 private static final long serialVersionUID = 1L;
63 private JPanel jContentPane = null;
64 private JLabel jLabelTitle = null;
65 private JEditorPane jEditorPaneLicense = null;
66 private JScrollPane jScrollPaneLicense = null;
67 private JLabel jLabel = null;
68 private JLabel jLabelHope = null;
69
70
71
72
73 public AboutDialog() {
74 super();
75 initialize();
76 }
77
78
79
80
81 public AboutDialog(Frame arg0) {
82 super(arg0);
83 initialize();
84 this.setLocationRelativeTo(arg0);
85 }
86
87
88
89
90 public AboutDialog(Dialog arg0) {
91 super(arg0);
92 initialize();
93 this.setLocationRelativeTo(arg0);
94 }
95
96
97
98
99 public static void main(String[] args) {
100 AboutDialog aboutDialog = new AboutDialog();
101 aboutDialog.setVisible(true);
102 }
103
104
105
106
107 public void setVersion(String version) {
108 this.setTitle("About BuckoFIBS-" + version);
109 this.jLabelTitle.setText("BuckoFIBS-" + version);
110 }
111
112
113
114
115
116
117 private JEditorPane getJEditorPaneLicense() {
118 if (jEditorPaneLicense == null) {
119 jEditorPaneLicense = new JEditorPane();
120 try {
121 jEditorPaneLicense.setPage(getClass().getResource("/LICENSE.html"));
122 jEditorPaneLicense.setEditable(false);
123 } catch (IOException e) {
124 e.printStackTrace();
125 }
126 }
127 return jEditorPaneLicense;
128 }
129
130
131
132
133
134
135 private JScrollPane getJScrollPaneLicense() {
136 if (jScrollPaneLicense == null) {
137 jScrollPaneLicense = new JScrollPane();
138 jScrollPaneLicense.setViewportView(getJEditorPaneLicense());
139 }
140 return jScrollPaneLicense;
141 }
142
143
144
145
146
147
148 private void initialize() {
149 this.setSize(717, 330);
150 this.setTitle("About BuckoFIBS-X.X");
151 this.setContentPane(getJContentPane());
152 }
153
154
155
156
157
158
159 private JPanel getJContentPane() {
160 if (jContentPane == null) {
161 GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
162 gridBagConstraints4.gridx = 0;
163 gridBagConstraints4.gridy = 2;
164 jLabelHope = new JLabel();
165 jLabelHope.setText("It is the hope and desire of the original author that any changes or improvements you make are reflected back to the original program.");
166 jLabelHope.setFont(new Font("Dialog", Font.PLAIN, 10));
167 GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
168 gridBagConstraints3.gridx = 0;
169 gridBagConstraints3.anchor = GridBagConstraints.WEST;
170 gridBagConstraints3.weighty = 0.0;
171 gridBagConstraints3.insets = new Insets(0, 0, 5, 0);
172 gridBagConstraints3.gridy = 1;
173 jLabel = new JLabel();
174 jLabel.setText("Copyright© 2009 Dick Balaska & BuckoSoft, Corp.");
175 GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
176 gridBagConstraints2.fill = GridBagConstraints.BOTH;
177 gridBagConstraints2.gridy = 3;
178 gridBagConstraints2.weightx = 1.0;
179 gridBagConstraints2.weighty = 1.0;
180 gridBagConstraints2.gridx = 0;
181 GridBagConstraints gridBagConstraints = new GridBagConstraints();
182 gridBagConstraints.insets = new Insets(7, 0, 0, 0);
183 gridBagConstraints.gridy = 0;
184 gridBagConstraints.ipadx = 0;
185 gridBagConstraints.weighty = 0.0;
186 gridBagConstraints.anchor = GridBagConstraints.NORTH;
187 gridBagConstraints.gridx = 0;
188 jLabelTitle = new JLabel();
189 jLabelTitle.setText("BuckoFIBS-X.X");
190 jContentPane = new JPanel();
191 jContentPane.setLayout(new GridBagLayout());
192 jContentPane.add(jLabelTitle, gridBagConstraints);
193 jContentPane.add(getJScrollPaneLicense(), gridBagConstraints2);
194 jContentPane.add(jLabel, gridBagConstraints3);
195 jContentPane.add(jLabelHope, gridBagConstraints4);
196 }
197 return jContentPane;
198 }
199
200 }