JAVA新手求助,看看哪里错了
输出星期的代码,求大神指点!!public class Weekend {
public static void main(String args[])
{
String stringNumber;String week="";
int number = 0;
while(number<1||number>7) {
stringNumber = JOptionPane.showInputDialog( "输入一个数(1---7)");
number = Integer.parseInt( stringNumber );
}
switch(number)
{ case 1 : week ="星期一";break;
case 2 : week ="星期二";break;
case 3 : week ="星期三";break;
case 4 : week ="星期四";break;
case 5 : week ="星期五";break;
case 6 : week ="星期六";break;
case 7 : week ="星期日";break;
}
JOptionPane.showMessageDialog( null,"星期是:"+week,"结果",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
报错:
--------------------Configuration: Java <Default>--------------------
D:\JCreator Pro\MyProjects\FindMax\weekend\Weekend.java:7: 找不到符号
符号: 变量 JOptionPane
位置: 类 Weekend
stringNumber = JOptionPane.showInputDialog( "输入一个数(1---7)");
^
D:\JCreator Pro\MyProjects\FindMax\weekend\Weekend.java:19: 找不到符号
符号: 变量 JOptionPane
位置: 类 Weekend
JOptionPane.showMessageDialog( null,"星期是:"+week,"结果",JOptionPane.PLAIN_MESSAGE);
^
D:\JCreator Pro\MyProjects\FindMax\weekend\Weekend.java:19: 找不到符号
符号: 变量 JOptionPane
位置: 类 Weekend
JOptionPane.showMessageDialog( null,"星期是:"+week,"结果",JOptionPane.PLAIN_MESSAGE);
^
3 错误
Process completed.