import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Component8_8 extends JFrame implements ActionListener
{
	JButton button;
	JLabel label;
	JTextField t1;
	JTextField t2;
	public Component8_8()
	{		
		button=new JButton("输出");
		label=new JLabel("年份：");
		t1=new JTextField(4);
		t2=new JTextField(4);
		this.setLayout(new FlowLayout());
		this.add(label);
		this.add(t1);
		this.add(button);		
		this.add(t2);
		button.addActionListener(this);
	}	
	public void actionPerformed(ActionEvent e)
	{
		String str=t1.getText();
		Boolean flag=false;
		int a;
		a=Integer.parseInt(str);
		if(a%4==0&&a%100!=0||a%400==0)
		{
			flag=true;
		}
		if(flag)
		{
			t2.setText("闰年");
		}else
		{
			t2.setText("平年");
		}
	}
	public static void main(String[] args) 
	{
		Component8_8 frame=new Component8_8();
		frame.pack();
		frame.setVisible(true);
	}
}