AboutDialog.java
资源名称:tanqiu2.rar [点击查看]
上传用户:mgrzxhaci
上传日期:2009-12-20
资源大小:18k
文件大小:1k
源码类别:
其他游戏
开发平台:
Java
- package notebook;
- import java.awt.*;
- import javax.swing.*;
- import java.awt.event.*;
- public class AboutDialog extends JDialog {
- JPanel panel1 = new JPanel();
- JPanel jPanel1 = new JPanel();
- JLabel jLabel1 = new JLabel();
- JButton jButton1 = new JButton();
- public AboutDialog(Frame frame, String title, boolean modal) {
- super(frame, title, modal);
- try {
- jbInit();
- pack();
- }
- catch(Exception ex) {
- ex.printStackTrace();
- }
- }
- public AboutDialog() {
- this(null, "", false);
- }
- private void jbInit() throws Exception {
- jLabel1.setText("版本1.0");
- jButton1.setText("确 定");
- jButton1.addActionListener(new AboutDialog_jButton1_actionAdapter(this));
- getContentPane().add(panel1);
- panel1.add(jLabel1, null);
- this.getContentPane().add(jPanel1, BorderLayout.SOUTH);
- jPanel1.add(jButton1, null);
- this.setLocation(400,300);
- this.setSize(150,100);
- this.setVisible(true);
- this.setTitle("About");
- }
- void jButton1_actionPerformed(ActionEvent e) {
- this.dispose();
- }
- }
- class AboutDialog_jButton1_actionAdapter implements java.awt.event.ActionListener {
- AboutDialog adaptee;
- AboutDialog_jButton1_actionAdapter(AboutDialog adaptee) {
- this.adaptee = adaptee;
- }
- public void actionPerformed(ActionEvent e) {
- adaptee.jButton1_actionPerformed(e);
- }
- }