OSPE_AboutBoxPanel.java
2.58 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package osp.ui;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* This class is the about box that contains information about the program.
*/
public class OSPE_AboutBoxPanel extends JDialog {
private static final long serialVersionUID = 1L;
/** Close button */
private JButton closeButton = new JButton();
/** Product name */
private String product = "OSP Editor";
/** Current version */
private String version = "version 3.5 - November 2020";
/** Copyright information */
private String copyright = "Copyright (c)";
/** Comments */
private String comments = "IRAP Control Group Software";
/**
* Constructs the "About" window.
*/
public OSPE_AboutBoxPanel() {
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
JPanel insetsPanel1 = new JPanel();
JPanel insetsPanel2 = new JPanel();
JPanel insetsPanel3 = new JPanel();
FlowLayout flowLayout = new FlowLayout();
setTitle("About");
panel1.setLayout(new BorderLayout());
panel2.setLayout(new BorderLayout());
insetsPanel2.setLayout(flowLayout);
insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JLabel imageLabel = new JLabel();
imageLabel.setIcon(ImageUtils.createImageIcon("icons/logo_irap.jpg"));
insetsPanel2.add(imageLabel, null);
panel2.add(insetsPanel2, BorderLayout.WEST);
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(4);
gridLayout.setColumns(1);
insetsPanel3.setLayout(gridLayout);
insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10));
insetsPanel3.add(new JLabel(product));
insetsPanel3.add(new JLabel(version));
insetsPanel3.add(new JLabel(copyright));
insetsPanel3.add(new JLabel(comments));
panel2.add(insetsPanel3, BorderLayout.CENTER);
insetsPanel1.setLayout(flowLayout);
closeButton.setText("CLOSE");
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}
});
insetsPanel1.add(closeButton);
panel1.add(insetsPanel1, BorderLayout.SOUTH);
panel1.add(panel2, BorderLayout.NORTH);
getContentPane().add(panel1);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setResizable(true);
pack();
setVisible(true);
}
public static void main(String[] args) {
new OSPE_AboutBoxPanel();
}
}