\
{
public void actionPerformed(ActionEvent e) { Button_dayyearboxActionPerformed(e); } });
}
pane_day.add(Label_title[i]);
for (int i = 0; i < 42; i++) {
Button_day[i] = new JButton(\Button_day[i].setFont(new
Font(\
\
Button_day[i].setBorderPainted(false); Button_day[i].setContentAreaFilled(false); pane_day.add(Button_day[i]);
Button_day[i].addMouseListener(police);
Button_day[i].addActionListener(new ActionListener()
}
this.setYM();
this.setImg(month_num); this.setDay(); this.add(jP);
//jp.setSize(1150,750);
//jp.setContentAreaFilled(false); this.setLayout(new BorderLayout()); this.add(pane_ym, BorderLayout.NORTH); //this.setSize(100,250); this.setSize(1150,750);
jP.setOpaque(false);
this.add(pane_day, BorderLayout.CENTER);
setSize(1150,750); //setSize(300,300);
}
void setYM() { }
void setDay() { ֵ
//·
if (month_num == 0||month_num == 2 ||month_num == 4 for (int i = 0; i < 7; i++) { }
Label_title[i].setText(week[i]);
String week[] = { \\\һ\\\\\\\\\\};
int day = 0; int day_week = 0;
GregorianCalendar cal = new GregorianCalendar(); //һcal.setTime(dt);
Calendarʵ
Date dt = new Date(year_set, month_num, 1); //һint year_set = Integer.parseInt(year_num) - 1900; //if (bool) { } else { }
year_num = Year.getText();
month_num = Month.getSelectedIndex();
year_num = this_year + \month_num = this_month;
||month_num == 6 ||
}
month_num == 7|| month_num == 9 ||month_num == 11) { day = 31;
else if (month_num == 3 ||month_num == 5 || } else{ }
day_week = dt.getDay(); int count = 1;
for (int i = day_week; i < day_week + day; count++, i++) {
if (i % 7 == 0 ||i == 13||i == 20||i == 27||
}
if (i == day_week + this_date.getDate() -1) {
Button_day[i].setText(count + \Button_day[i].setForeground(Color.black); i == 6 ||i == 34 ||i == 41) {
Button_day[i].setForeground(Color.blue); Button_day[i].setText(count + \Button_day[i].setForeground(Color.red); Button_day[i].setText(count + \if (i == day_week + this_date.getDate() -1) { if (cal.isLeapYear(year_set)) { } else { }
day = 28; day = 29;
month_num == 8 ||month_num == 10) { day = 30;
} else {
} else {
Button_day[i].setForeground(Color.blue);
} else {
}
}
}
}
Button_day[i].setText(count + \
if (day_week == 0) { }
for (int i = day; i < 42; i++) { }
for (int i = 0; i < day_week; i++) { }
for (int i = day_week + day; i < 42; i++) { }
Button_day[i].setText(\
Button_day[i].setText(\
Button_day[i].setText(\
Button_day[i].setContentAreaFilled(false); Button_day[i].addActionListener(this);
} else {
Calendar calendar= Calendar.getInstance();
public int getYear(){return Integer.parseInt(year_num);} public int getMonth(){return month_num;}
public int getWeek(){ Ƭ
imgLabel = new JLabel(img[0]);//ͼڱǩ
week=calendar.get(DAY_OF_WEEK); return week;}
//System.out.println(month_num); /*if(mon_num==0){
img[0] = new ImageIcon(\DZͼ
void setImg(int month_num){
//month_num = Month.getSelectedIndex();