做如下修改:
public void start() { //加法在这里进行
x=Integer.parseInt(JOptionPane.showInputDialog("please input a value"));
y=Integer.parseInt(JOptionPane.showInputDialog("please input a value"));
sum=x+y;
first.setText("The X is " + x);
second.setText("The Y is " + y);
third.setText("The SUM is "+sum);
}
public void start() { //加法在这里进行
x=Integer.parseInt(JOptionPane.showInputDialog("please input a value"));
y=Integer.parseInt(JOptionPane.showInputDialog("please input a value"));
sum=x+y;
first.setText("The X is " + x);
second.setText("The Y is " + y);
third.setText("The SUM is "+sum);
}
如果使用上述代码,first对象将会显示在Dialog中,下列方式更好:
x=Integer.parseInt(JOptionPane.showInputDialog("first"));
请问那里有关于这些常用的方法的用法介绍啊