|
|
我是名JAVA的新手
其实我也不太懂java可以在这开贴吗?
刚刚学习了JAVA第三天 终于会做GUI了
是一个小小的只有sum calculator 可是也很开心==
我是使用eclipse来做的
可是该tutorial并没教我怎样把成品弄出来给人看
所以我想问各位怎样把java的东西弄出来变成.exe之类使用呢?
我的code如下:
import javax.swing.JOptionPane;
class apples {
public static void main(String[] args){
String fn = JOptionPane.showInputDialog("Enter first number (999 to stop this)");
int num1 = Integer.parseInt(fn);
while(num1!=999){
String sn = JOptionPane.showInputDialog("Enter second number");
int num2 = Integer.parseInt(sn);
int sum= num1 + num2;
JOptionPane.showMessageDialog(null, "The answer is " +sum, "the title", JOptionPane.PLAIN_MESSAGE);
fn = JOptionPane.showInputDialog("Enter first number (999 to stop this)");
num1 = Integer.parseInt(fn);
}
JOptionPane.showMessageDialog(null, "GOOD BYE");
}
} |
|