老师要我们写简易计算器。我现在想把监听器中的数据取出来,请问该怎么做
button_jia.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String input = e.getActionCommand();
anw.append(input);
System.out.println(input);
String cal = anw.toString();
String fuhao = "+";
label.setText(anw.toString());
anw.setLength(0);
}
});
要取出cal的值