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

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

    @Override
    public void actionPerformed(ActionEvent e) {
        JButton b=(JButton) e.getSource();
        String btnName=b.getText().trim();//去除前后空白区
        char dight=btnName.charAt(0);
        window.computer.setDataItem(dight);
        show();
        if(dight=='.'){
            String s=get(window.computer.computerDataItem());
            window.showDataItem.setText(" "+s+".");
        }
    }
}
