if(e.getSource()==Lmonth) {
if(month>=2) {
month=month-1;
calendar.setMonth(month);
calendar.setcalendar(calendar.getYear(),month); }
else if(month==1) { month=12;
calendar.setMonth(month);
calendar.setcalendar(calendar.getYear(),month); }
showMonth.setText(\}
else if(e.getSource()==Nmonth) {
if(month<12) {
month=month+1; calendar.setMonth(month);
calendar.setcalendar(calendar.getYear(),month); }
else if(month==12) { month=1;
calendar.setMonth(month);
calendar.setcalendar(calendar.getYear(),month); }
showMonth.setText(\} } }
class Year extends Box implements ActionListener //控制年份 {
int year;
JTextField showYear=null; JButton Nyear,Lyear; CalendarPad calendar;
public Year(CalendarPad calendar) {
super(BoxLayout.X_AXIS); showYear=new JTextField(4); showYear.setForeground(Color.blue);
showYear.setFont(new Font(\ this.calendar=calendar; year=calendar.getYear();