aboutdialog.java

来自「好的超市源码供大家下载」· Java 代码 · 共 51 行

JAVA
51
字号
package view.dialog;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

/**
 * 关于对话框
 * @author linfeng
 *
 */
public class AboutDialog extends JDialog implements ActionListener {
  
  /**
   * dialog 对话框
   * aboutLabel 关于标签
   * message 版权标签
   * button 确定按钮
   */
  private JDialog dialog;
  private JLabel aboutLabel,version;
  private JButton button;

  public AboutDialog() {
    dialog = new JDialog();
    dialog.setSize(150,100);
    dialog.setLocation(280,50);
    dialog.setTitle("关于");
    aboutLabel = new JLabel("超市管理系统1.0版", JLabel.CENTER);
    button = new JButton("确定");
    button.addActionListener(this);
    version = new JLabel("版权所有,2008年4月");
    dialog.setLayout(new FlowLayout());
    dialog.add(aboutLabel);
    dialog.add(button);
    dialog.add(version);
    dialog.setVisible(true);
    
  }

  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("确定")) {
      dialog.dispose();
    }
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?