⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huanying.java

📁 一個模仿ATM自動提款机功能的系統,
💻 JAVA
字号:
package MainFrame;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;

public class HuanYing extends JFrame {
    XYLayout xYLayout1 = new XYLayout();
    JLabel jLabel1 = new JLabel();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    public HuanYing() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }
    private void jbInit() throws Exception {
        getContentPane().setLayout(xYLayout1);
        jButton1.addActionListener(new HuanYing_jButton1_actionAdapter(this));
        this.addWindowListener(new HuanYing_this_windowAdapter(this));
        jButton2.addActionListener(new HuanYing_jButton2_actionAdapter(this));
        this.getContentPane().add(jLabel1, new XYConstraints(1, 1, 398, 291));
        jLabel1.setIcon(new ImageIcon("image/1.jpg"));
        jButton2.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
        jButton2.setText("取消");
        this.getContentPane().add(jButton1, new XYConstraints(45, 305, 82, 35));
        this.getContentPane().add(jButton2, new XYConstraints(210, 305, 82, 35));
        jButton1.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
        jButton1.setText("確定");
    }

    public static void main(String[] args) {
        HuanYing h = new HuanYing();
        h.setBounds(200,200,400,400);
        h.setVisible(true);
    }

    public void jButton1_actionPerformed(ActionEvent e) {
            this.dispose();
            TiShi t=new TiShi();
            t.setTitle("欢迎");
            t.setBounds(200,200,400,400);
            t.setVisible(true);
    }

    public void this_windowClosing(WindowEvent e) {
        System.exit(0);
    }

    public void jButton2_actionPerformed(ActionEvent e) {
             JOptionPane.showMessageDialog(null,"谢谢您的光顾");
    }
}


class HuanYing_this_windowAdapter extends WindowAdapter {
    private HuanYing adaptee;
    HuanYing_this_windowAdapter(HuanYing adaptee) {
        this.adaptee = adaptee;
    }

    public void windowClosing(WindowEvent e) {
        adaptee.this_windowClosing(e);
    }
}


class HuanYing_jButton2_actionAdapter implements ActionListener {
    private HuanYing adaptee;
    HuanYing_jButton2_actionAdapter(HuanYing adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton2_actionPerformed(e);
    }
}


class HuanYing_jButton1_actionAdapter implements ActionListener {
    private HuanYing adaptee;
    HuanYing_jButton1_actionAdapter(HuanYing adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}

⌨️ 快捷键说明

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