做如下修改:
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);
}
解决方案 »
- 为什么用BufferedReader读文件每次都结果都不一样
- 关于数据的过滤(版本及状态)
- 急求!!!Math类中round(double a)与round(float a)方法的不同
- 链表小白题
- java.io.InputStream中的int read(byte[] b, int off, int len) 方法的疑问
- 求java开发WEB程序的教程
- DeskTop 中添加InternalFrame的位置问题?
- 请问:如果已知一个日期(string型)想获得它的下一天的日期该怎么做?(急!)
- 请上海的朋友干私活
- 哪里可以看到Weblogic的在线文档?请给出具体连接,急急急
- 我编了一个servlet想用来接受网页的请求,网页有要求要放在什么目录吗?
- 哪里错了
如果使用上述代码,first对象将会显示在Dialog中,下列方式更好:
x=Integer.parseInt(JOptionPane.showInputDialog("first"));
请问那里有关于这些常用的方法的用法介绍啊