📄 aboutdialog.java
字号:
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* Description of the Class
*
* @author kilo
* @created 2003年12月22日
*/
public final class AboutDialog
extends JDialog
implements ActionListener {
/**
* Description of the Field
*/
JPanel panel1 = new JPanel();
/**
* Description of the Field
*/
JPanel panel2 = new JPanel();
/**
* Description of the Field
*/
JPanel insetsPanel1 = new JPanel();
/**
* Description of the Field
*/
JPanel insetsPanel2 = new JPanel();
/**
* Description of the Field
*/
JPanel insetsPanel3 = new JPanel();
/**
* Description of the Field
*/
JButton button1 = new JButton();
/**
* Description of the Field
*/
JLabel imageLabel = new JLabel();
/**
* Description of the Field
*/
JLabel label1 = new JLabel();
/**
* Description of the Field
*/
JLabel label2 = new JLabel();
/**
* Description of the Field
*/
JLabel label3 = new JLabel();
/**
* Description of the Field
*/
JLabel label4 = new JLabel();
/**
* Description of the Field
*/
ImageIcon image1 = new ImageIcon();
/**
* Description of the Field
*/
BorderLayout borderLayout1 = new BorderLayout();
/**
* Description of the Field
*/
BorderLayout borderLayout2 = new BorderLayout();
/**
* Description of the Field
*/
FlowLayout flowLayout1 = new FlowLayout();
/**
* Description of the Field
*/
GridLayout gridLayout1 = new GridLayout();
/**
* Description of the Field
*/
String product = "mp3文件改名小工具";
/**
* Description of the Field
*/
String version = "版本:0.01";
/**
* Description of the Field
*/
String copyright = "邮箱:whg_2001@sohu.com";
/**
* Description of the Field
*/
String comments = "";
/**
* Constructor for the AboutDialog object
*
* @param parent Description of the Parameter
* @exception Exception Description of the Exception
*/
public AboutDialog( Frame parent )
throws Exception {
super( parent );
enableEvents( AWTEvent.WINDOW_EVENT_MASK );
jbInit();
}
//Component initialization
/**
* Description of the Method
*
* @exception Exception Description of the Exception
*/
private void jbInit()
throws Exception {
image1 = new ImageIcon( Mp3NC.class.getResource( "aboutbig.png" ) );
imageLabel.setIcon( image1 );
this.setTitle( "关于" );
panel1.setLayout( borderLayout1 );
panel2.setLayout( borderLayout2 );
insetsPanel1.setLayout( flowLayout1 );
insetsPanel2.setLayout( flowLayout1 );
insetsPanel2.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );
gridLayout1.setRows( 4 );
gridLayout1.setColumns( 1 );
label1.setText( product );
label2.setText( version );
label3.setText( copyright );
label4.setText( comments );
insetsPanel3.setLayout( gridLayout1 );
insetsPanel3.setBorder( BorderFactory.createEmptyBorder( 10, 60, 10, 10 ) );
button1.setText( "关闭" );
button1.addActionListener( this );
insetsPanel2.add( imageLabel, null );
panel2.add( insetsPanel2, BorderLayout.WEST );
this.getContentPane().add( panel1, null );
insetsPanel3.add( label1, null );
insetsPanel3.add( label2, null );
insetsPanel3.add( label3, null );
insetsPanel3.add( label4, null );
panel2.add( insetsPanel3, BorderLayout.CENTER );
insetsPanel1.add( button1, null );
panel1.add( insetsPanel1, BorderLayout.SOUTH );
panel1.add( panel2, BorderLayout.NORTH );
setResizable( true );
}
//Overridden so we can exit when window is closed
/**
* Description of the Method
*
* @param e Description of the Parameter
*/
protected void processWindowEvent( WindowEvent e ) {
if ( e.getID() == WindowEvent.WINDOW_CLOSING )
cancel();
super.processWindowEvent( e );
}
//Close the dialog
/**
* Description of the Method
*/
void cancel() {
dispose();
}
//Close the dialog on a button event
/**
* Description of the Method
*
* @param e Description of the Parameter
*/
public void actionPerformed( ActionEvent e ) {
if ( e.getSource() == button1 )
cancel();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -