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

📄 checkframe.java

📁 超市管理系统 运行环境JDK1.4以上 JB2006 源代码公开
💻 JAVA
字号:
package com.aptech.view;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Rectangle;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class CheckFrame extends JFrame {
    String id;
    public CheckFrame(String id) {
        try {
            this.id=id;
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        jButton1.setBackground(Color.cyan);
        jButton1.setBounds(new Rectangle(10, 51, 129, 48));
        jButton1.setText("管理系统");
        this.getContentPane().setBackground(new Color(0, 255, 190));
        setTitle("一切为了顾客");
        jButton1.addActionListener(new CheckFrame_jButton1_actionAdapter(this));
        jLabel1.setFont(new java.awt.Font("黑体", Font.BOLD, 25));
        jLabel1.setForeground(Color.red);
        jLabel1.setText("请选择");
        jLabel1.setBounds(new Rectangle(105, 8, 109, 42));
        jButton2.setBackground(Color.cyan);
        jButton2.addActionListener(new CheckFrame_jButton2_actionAdapter(this));
        this.getContentPane().add(jButton1);
        this.getContentPane().add(jButton2);
        this.getContentPane().add(jLabel1);
        jButton2.setBounds(new Rectangle(150, 51, 129, 48));
        jButton2.setText("收银系统");
    }

    public static void main(String[] args) {

    }

    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JLabel jLabel1 = new JLabel();
    public void jButton1_actionPerformed(ActionEvent actionEvent) {
         MainFrame mm=new MainFrame();
         mm.setSize(500,400);
         mm.setVisible(true);
         mm.setLocationRelativeTo(this);

    }

    public void jButton2_actionPerformed(ActionEvent actionEvent) {
          GoodsaleFrame sa = new GoodsaleFrame(id);
          sa.setSize(400, 350);
          sa.setVisible(true);
          sa.setLocationRelativeTo(this);

    }
}


class CheckFrame_jButton2_actionAdapter implements ActionListener {
    private CheckFrame adaptee;
    CheckFrame_jButton2_actionAdapter(CheckFrame adaptee) {
        this.adaptee = adaptee;
    }

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


class CheckFrame_jButton1_actionAdapter implements ActionListener {
    private CheckFrame adaptee;
    CheckFrame_jButton1_actionAdapter(CheckFrame adaptee) {
        this.adaptee = adaptee;
    }

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

⌨️ 快捷键说明

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