checkframe.java~10~

来自「超市管理系统 运行环境JDK1.4以上 JB2006 源代码公开」· JAVA~10~ 代码 · 共 91 行

JAVA~10~
91
字号
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 {
    public CheckFrame() {
        try {
            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) {
        CheckFrame checkframe = new CheckFrame();
    }

    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();
          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 + =
减小字号Ctrl + -
显示快捷键?