这个程序为啥无法成功啊
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class leapyear extends Applet implements ActionListener
{
Label result;
TextField inl;
Button btn;
int year;
boolean leap;
public void init()
{
result=new Label("请先输入待判断的年份");
inl=new TextField(5);
add(inl);
add(btn);
add(result);
btn.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
year=Integer.parseInt(inl.getText());
if(year%4!=0)
leap=false;
else if(year%100!=0)
leap=true;
else if(year%400!=0)
leap=false;
else
leap=true;
if(leap==true)
result.setText(year+"年是闰年");
else
result.setText(year+"年不是闰年");
inl.setText(" ");
}
}
[解决办法]
类名首字母为啥是小写?
[解决办法]
另外,你这程序哪里 不成功了?
[解决办法]