当前位置: 代码迷 >> Eclipse >> 新手请问众牛一个有关问题!
  详细解决方案

新手请问众牛一个有关问题!

热度:25   发布时间:2016-04-23 00:20:51.0
新手请教众牛一个问题!!
package yunfeng;
import javax.swing.JOptionPane;
public class SimpleleIfDemo {
public static void main(String args[]) {
String numberString = JOPtionPane.showInputDialog("请输入一个数字:");
int number = Integer.parseInt(numberString);
if(number%5==0) {
String output1 = "HiFive!";
JOptionPane.showMessageDialog(null,output1);
}
if(number%2==0) {
String output2 = "HiEven";
JOptionPane.showMessageDialog(null, output2);
}
}
}


请问大家这段代码有错吗?编译报错Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
JOPtionPane cannot be resolved

at yunfeng.SimpleleIfDemo.main(SimpleleIfDemo.java:5)
急!!!thank you
------解决思路----------------------
JOptionPane

JOPtionPane

你写错了
------解决思路----------------------
javax.swing包是否引入?
  相关解决方案