在java中如何将字符串格式转换为整型,试过用parseInt函数,仍有问题,谁可以帮忙看一下?
public class ButtonHandler implements ActionListener{
public Button btn;
public TextField tf1;
public TextField tf2;
public Label lab5;
public int a,b,c;
public void actionPerformed(ActionEvent e){
    a= Int.parseInt(tf1.getText());
    b= Int.parseInt(tf2.getText());
    c=a+b;
    String str=e.getActionCommand();
    if(str.equals("求和")){
...?
    lab5.setText(c);
}
}