📄 about.java
字号:
package com.personnel;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
import javax.swing.JTabbedPane;
import java.awt.GridBagConstraints;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.image.*;
import javax.imageio.*;
import java.awt.event.KeyEvent;
import javax.swing.JTextArea;
import java.awt.Insets;
import javax.swing.WindowConstants;
import java.awt.Font;
import java.awt.SystemColor;
public class About extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JTabbedPane jTabbedPane = null;
private JPanel jPanel = null;
private JPanel jPanel1 = null;
private JLabel jLabel = null;
private JTextArea jTextArea = null;
private JTextArea jTextArea1 = null;
private JLabel jLabel1 = null;
/**
* This is the default constructor
*/
public About() {
super();
this.initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(420, 368);
this.setResizable(false);
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setContentPane(this.getJContentPane());
this.setTitle("About");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// The frame is placed in the middle;
this.setLocation(screenSize.width / 2 - this.getWidth() / 2,
screenSize.height / 2 - this.getHeight() / 2);
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (this.jContentPane == null) {
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = GridBagConstraints.BOTH;
gridBagConstraints.gridy = 0;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new Insets(0, 0, 0, 0);
gridBagConstraints.gridx = 0;
this.jContentPane = new JPanel();
this.jContentPane.setLayout(new GridBagLayout());
this.jContentPane.add(this.getJTabbedPane(), gridBagConstraints);
}
return this.jContentPane;
}
/**
* This method initializes jTabbedPane
*
* @return javax.swing.JTabbedPane
*/
private JTabbedPane getJTabbedPane() {
if (this.jTabbedPane == null) {
this.jTabbedPane = new JTabbedPane();
this.jTabbedPane.addTab("关于", null, this.getJPanel(), null);
this.jTabbedPane.addTab("帮助", null, this.getJPanel1(), null);
}
return this.jTabbedPane;
}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel() {
if (this.jPanel == null) {
GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.gridy = 1;
this.jLabel1 = new JLabel();
this.jLabel1.setText("MyE-Mail:sonichui@163.com");
this.jLabel1.setFont(new Font("Dialog", Font.PLAIN, 18));
GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
gridBagConstraints1.fill = GridBagConstraints.BOTH;
gridBagConstraints1.gridy = 0;
gridBagConstraints1.weightx = 1.0;
gridBagConstraints1.weighty = 1.0;
gridBagConstraints1.insets = new Insets(18, 8, 19, 10);
gridBagConstraints1.gridx = 1;
this.jLabel = new JLabel();
this.jLabel.setText("");
try {
java.io.File file = new java.io.File(
"com/personnel/resources/chara_sonic.gif");
BufferedImage pic;
pic = ImageIO.read(file);
pic.setRGB(50, 50, BufferedImage.TYPE_INT_RGB);
this.jLabel.setIcon(new ImageIcon(pic));
} catch (Exception e) {
e.printStackTrace();
}
this.jLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
this.jPanel = new JPanel();
this.jPanel.setLayout(new GridBagLayout());
this.jPanel.setName("");
this.jPanel.add(this.jLabel, new GridBagConstraints());
this.jPanel.add(this.getJTextArea(), gridBagConstraints1);
this.jPanel.add(this.jLabel1, gridBagConstraints3);
}
return this.jPanel;
}
/**
* This method initializes jPanel1
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel1() {
if (this.jPanel1 == null) {
GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
gridBagConstraints2.fill = GridBagConstraints.BOTH;
gridBagConstraints2.gridy = 0;
gridBagConstraints2.weightx = 1.0;
gridBagConstraints2.weighty = 1.0;
gridBagConstraints2.insets = new Insets(20, 20, 20, 20);
gridBagConstraints2.gridx = 0;
this.jPanel1 = new JPanel();
this.jPanel1.setLayout(new GridBagLayout());
this.jPanel1.add(this.getJTextArea1(), gridBagConstraints2);
}
return this.jPanel1;
}
/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea() {
if (this.jTextArea == null) {
this.jTextArea = new JTextArea();
this.jTextArea
.setText("\n\n\n\n\n作者:陈辉鸿\n版本:Vesion 1.0\n时间:2008/3/5\n");
this.jTextArea.setBackground(SystemColor.controlHighlight);
this.jTextArea.setEditable(false);
}
return this.jTextArea;
}
/**
* This method initializes jTextArea1
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea1() {
if (this.jTextArea1 == null) {
this.jTextArea1 = new JTextArea();
this.jTextArea1.setText("");
this.jTextArea1.setEditable(false);
}
return this.jTextArea1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -