import javax.swing.*;
import java.awt.event.ActionEvent;

public class HandleOperator extends HandleEvent{
    public HandleOperator(CalculatorWindow window) {
        super(window);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        JButton b=(JButton) e.getSource();
        String btnName;
        btnName=b.getText().trim();//去除前后空白区
        char operator=btnName.charAt(0);
        window.computer.setOperator(operator);
        show();
    }
}
