📄 aboutdialog.java
字号:
package myprojects.aboutdialog;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.util.*;
import javax.swing.table.*;
import java.util.Vector;
import java.util.*;
import java.text.*;
/**
* @(#)AboutDialog.java
*
* 关于对话框
*
* @author
* @version 1.00 05/12/25
*/
public class AboutDialog extends JFrame
{
private JLabel lab_icon = new JLabel();
private JLabel jLabel1 = new JLabel();
private JLabel jLabel2 = new JLabel();
private JPanel jPanel1 = new JPanel();
private JLabel jLabel3 = new JLabel();
private JLabel jLabel5 = new JLabel();
private JButton jButton1 = new JButton();
private Label label1 = new Label();
public AboutDialog()
{
try
{
jbInit();
setResizable(false); //使之不能改变大小
}
catch(Exception e)
{
e.printStackTrace();
}
}
private void jbInit() throws Exception
{
lab_icon.setBorder(BorderFactory.createEtchedBorder());
lab_icon.setBounds(new Rectangle(9, 9, 143, 110));
this.getContentPane().setBackground(Color.white);
this.getContentPane().setLayout(null);
jLabel1.setFont(new java.awt.Font("Serif", 1, 28));
jLabel1.setToolTipText("");
jLabel1.setText(" BlueMood");
jLabel1.setBounds(new Rectangle(168, 22, 155, 24));
jLabel2.setFont(new java.awt.Font("Serif", 0, 13));
jLabel2.setText("HotelManager V1.0");
jLabel2.setBounds(new Rectangle(180, 70, 155, 19));
jPanel1.setBackground(Color.lightGray);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(-5, 125, 333, 72));
jPanel1.setLayout(null);
jLabel3.setFont(new java.awt.Font("Serif", 0, 12));
jLabel3.setText("制作:云大软件学院BlueMood制作组");
jLabel3.setBounds(new Rectangle(17, 19, 217, 18));
jLabel5.setFont(new java.awt.Font("Serif", 0, 12));
jLabel5.setText("E-Mail: jinke@mail.ynu.edu.cn");
jLabel5.setBounds(new Rectangle(18, 39, 150, 18));
jButton1.setBounds(new Rectangle(250, 39, 64, 22));
jButton1.setFont(new java.awt.Font("Serif", 0, 12));
jButton1.setText("关闭");
jButton1.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
jButton1_actionPerformed(e);
}
});
label1.setText("E-Mail:jinke2005@263.net");
label1.setBounds(new Rectangle(156, 96, 147, 18));
this.getContentPane().add(lab_icon, null);
this.getContentPane().add(jLabel1, null);
this.getContentPane().add(jPanel1, null);
jPanel1.add(jButton1, null);
jPanel1.add(jLabel5, null);
jPanel1.add(jLabel3, null);
this.getContentPane().add(label1, null);
this.getContentPane().add(jLabel2, null);
ImageIcon icon1=createImageIcon(".\\aboutdialogImages\\BlueMood.JPG");
lab_icon.setIcon(icon1);
this.setTitle("关于本程序");
this.setBounds(200,200,330,230);
this.setVisible(true);
}
void jButton1_actionPerformed(ActionEvent e)
{
this.dispose();
}
/** Returns an ImageIcon, or null if the path was invalid. */
protected static ImageIcon createImageIcon(String path) {
java.net.URL imgURL = AboutDialog.class.getResource(path);
if (imgURL != null)
{
return new ImageIcon(imgURL);
}else{
System.err.println("Couldn't find file: " + path);
return null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -