📄 about.java
字号:
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
public class About extends JFrame
{
private JLabel iconLabel = new JLabel();
private JLabel label1 = new JLabel();
private JLabel label2 = new JLabel();
private BackgroundPanel jPanel1 = new BackgroundPanel("");
private JLabel label3 = new JLabel();
private JLabel label4 = new JLabel();
private JButton button = new JButton();
private Label label = new Label();
public About()
{
// change the style to the windows
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception ex){
}
try
{
initiate();
}
catch(Exception e)
{
e.printStackTrace();
}
}
private void initiate() throws Exception
{
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
iconLabel.setBorder(BorderFactory.createEtchedBorder());
iconLabel.setBounds(new Rectangle(8, 8, 147, 107));
this.getContentPane().setBackground(Color.white);
this.getContentPane().setLayout(null);
label1.setFont(new java.awt.Font("Serif", 1, 20));
label1.setToolTipText("");
label1.setText("Game Columns");
label1.setBounds(new Rectangle(154, 22, 155, 24));
label2.setFont(new java.awt.Font("Serif", 0, 13));
label2.setText(" Version @1.0");
label2.setBounds(new Rectangle(156, 65, 131, 19));
jPanel1.setBackground(Color.LIGHT_GRAY);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(-5, 125, 333, 95));
jPanel1.setLayout(null);
label3.setFont(new java.awt.Font("Serif", 0, 13));
label3.setText("Produced by: Fiend Work Studio");
label3.setBounds(new Rectangle(20, 19, 217, 18));
label4.setFont(new java.awt.Font("Serif", 0, 12));
label4.setText("Enjoy it!");
label4.setBounds(new Rectangle(20, 49, 129, 18));
button.setBounds(new Rectangle(150, 55, 64, 22));
button.setFont(new java.awt.Font("Serif", 0, 13));
button.setText("OK");
button.setForeground(Color.black);
button.setBackground(Color.white);
button.setOpaque(false);
button.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
buttonActionPerformed(e);
}
});
label.setText("E-Mail: neilyuli@163.com");
label.setBounds(new Rectangle(156, 85, 147, 18));
this.getContentPane().add(iconLabel, null);
this.getContentPane().add(label, null);
this.getContentPane().add(jPanel1, null);
jPanel1.add(button, null);
jPanel1.add(label4, null);
jPanel1.add(label3, null);
this.getContentPane().add(label1, null);
this.getContentPane().add(label2, null);
Icon icon1=new ImageIcon("pics\\about.jpg");
iconLabel.setIcon(icon1);
this.setTitle("About Game Columns 1.0");
this.setBounds(300,200,320,240);
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(((int)screen.getWidth()-250)/2,((int)screen.getHeight()-330)/2);
// change the style to the windows
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception ex){
}
}
void buttonActionPerformed(ActionEvent e)
{
this.dispose();
}
public void setPlace(double x,double y)
{
this.setLocation((int)x,(int)y);
}
public void run()
{
this.setVisible(true);
}
public void review()
{
this.repaint();
}
public static void main(String args[])
{
About obj=new About();
obj.run();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -