import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
class Mycalculator extends JFrame implements ActionListener
{
JFrame frame;
protected Container con = getContentPane();// 指向内容面板
protected JMenuBar a = new JMenuBar();// 菜单条
protected JMenu a1 = new JMenu("编辑(E)");// 菜单 1
protected JMenu a2 = new JMenu("帮助(H)");// 菜单 2
protected JMenuItem a11 = new JMenuItem("复制(C)", 'C');// 菜单 1 的菜单项
protected JMenuItem a12 = new JMenuItem("粘贴(P)", 'P');// 菜单 1 的菜单项
protected JMenuItem a21 = new JMenuItem("帮助主题(H)", 'H');// 菜单 2 的菜单项
protected JTextField text = new JTextField(30);// 文本框
protected JButton[] jb = new JButton[27];
protected String[] arr = { "Backspace", "CE", "C", "7", "8", "9", "/", "sqrt", "cbrt","4", "5", "6",
"*", "%", "x^x", "1", "2", "3", "-", "1/x","ln","0", "+/-", ".", "+", "=","lg", };
protected JPanel jp = new JPanel();// 主面板
protected JPanel m = new JPanel();// 次面板
protected JPanel m1 = new JPanel();// 次次面板
protected JPanel m2 = new JPanel();// 次次面板
protected JPanel m3 = new JPanel();// 次次面板
protected JPanel m4 = new JPanel();// 次次面板
protected JPanel m5 = new JPanel();// 次次面板
protected JPanel m6 = new JPanel();// 次次面板
protected GridLayout glo = new GridLayout(6, 1, 3, 3);// 主网格布局
protected GridLayout glo1 = new GridLayout(1, 3, 3, 3);// 次网格布局
protected GridLayout glo2 = new GridLayout(1, 6, 3, 3);// 次网格布局
int first=1;
String copycontent="";
boolean clickable=true,clear=true;
int all=0;
double answer;
String fuhao;
public Mycalculator()
{
a1.setMnemonic('E');
a1.addActionListener(this);
a1.add(a11);
a11.addActionListener(this);
a1.add(a12);
a2.addActionListener(this);