import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
//计算器数字按钮定义面板
class Number_Key
extends JPanel {
JButton zero = new JButton("0"); //数字键 0
JButton one = new JButton("1"); //数字键 1
JButton two = new JButton("2"); //数字键 2
JButton three = new JButton("3"); //数字键 3
JButton four = new JButton("4"); //数字键 4
JButton five = new JButton("5"); //数字键 5
JButton six = new JButton("6"); //数字键 6
JButton seven = new JButton("7"); //数字键 7
JButton eight = new JButton("8"); //数字键 8
JButton nine = new JButton("9"); //数字键 9
JButton plus = new JButton("+");
JButton sub = new JButton("-");
JButton mul = new JButton("*");
JButton div = new JButton("/");
JButton equal = new JButton("=");
JButton ce = new JButton("清零"); //置零键
JButton point = new JButton(".");
Number_Key() {
setLayout(new GridLayout(4, 4, 1, 1)); //定义布局管理器为网格布局
setBackground(Color.blue); //设置背景颜色
//添加按钮
add(one);
add(two);
add(three);
add(four);
add(five);
add(six);
add(seven);
add(eight);
add(nine);
add(zero);
add(plus);
add(sub);