[求助]为什么会出现这样的情况的?
原程序如下:/*编译通过,但是在运行的时候在命令诓中提示这样的语句:
Exception in thread "main" java.lang.NoClassDefFoundError:default <wrong name: Default>
at java.lang.ClassLoader.defineClass1<Native Method>
at java.lang.ClassLoader.defineClass<ClassLoader.java:620>
.........
*/
import java.awt.*;
import java.awt.event.*;
public class IsLeapYear extends Frame implements ActionListener
{
Label promptYear,promptMonth,promptResult;
TextField yearText,monthText;
public IsLeapYear(String strTitle)
{
super(strTitle);
setLayout(new FlowLayout());
promptYear=new Label("请输入年分");
yearText=new TextField(6);
promptMonth=new Label("请输入月份");
monthText=new TextField(6);
promptResult=new Label(" ");
add(promptYear);
add(yearText);
add(promptMonth);
add(monthText);
add(promptResult);
monthText.addActionListener(this);
pack();
show();
}
public static void main(String[] args)
{
IsLeapYear frameObj=new IsLeapYear("输入你给定的某年某月的天数");
frameObj.addWindowFocusListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
public void actionPerformed(ActionEvent e)
{
int year,month,numDay;
year=Integer.parseInt(yearText.getText());
month=Integer.parseInt(monthText.getText());
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: numDay=31;break;
case 4:
case 6:
case 9:
case 11: numDay=30;break;
case 2:
if(((year%4==0)&&(year%100!=0))||(year%400==0))
{
numDay=29;
}
else
{
numDay=28;
}
break;
default: numDay=-1;break;
}
if(numDay==-1)
{
promptResult.setText("输入的年月份有误");
}
else
{
promptResult.setText(year+"年"+month+"月有"+numDay+"天.");
}
}
}
请帮帮忙,谢谢!