java 找不到符号(新手救急!!!)
本人编了一个判断是否为闰年的小程序,出现了一些问题:import javax.swing.JOptionPane;
public class year
{
public static void main(String agrs[])
{
String nian;
String result1;
String result2;
int n;
result1="yes";
result2="no";
nian=JOptionPane.showlnputDialog("input the year");
n=lnteger.parselnt(nian);
if(n%4==0&&n%100!=0||n%400==0)
JoptionPane.showMessageDialog(null,"The result is "+result1,"answer",JOptionPane.PLAN_MESSAGE);
else
JoptionPane.showMessageDialog(null,"The result is "+result2,"answer",JOptionPane.PLAN_MESSAGE);
System.exit(0);
}
}
结果如下:
D:\>javac year.java
year.java:12: 找不到符号
符号: 方法 showlnputDialog(java.lang.String)
位置: 类 javax.swing.JOptionPane
nian=JOptionPane.showlnputDialog("input the year");
^
year.java:13: 找不到符号
符号: 变量 lnteger
位置: 类 year
n=lnteger.parselnt(nian);
^
year.java:15: 找不到符号
符号: 变量 PLAN_MESSAGE
位置: 类 javax.swing.JOptionPane
JoptionPane.showMessageDialog(null,"The result is "+result1,"answer",JOp
tionPane.PLAN_MESSAGE);
^
year.java:15: 找不到符号
符号: 变量 JoptionPane
位置: 类 year
JoptionPane.showMessageDialog(null,"The result is "+result1,"answer",JOp
tionPane.PLAN_MESSAGE);
^
year.java:17: 找不到符号
符号: 变量 PLAN_MESSAGE
位置: 类 javax.swing.JOptionPane
JoptionPane.showMessageDialog(null,"The result is "+result2,"answer",JOp
tionPane.PLAN_MESSAGE);
^
year.java:17: 找不到符号
符号: 变量 JoptionPane
位置: 类 year
JoptionPane.showMessageDialog(null,"The result is "+result2,"answer",JOp
tionPane.PLAN_MESSAGE);
^
6 错误