Sdate section:
class Sdate {
public static int accountdays (int year,int month) {
Switch (month) {
Case 1:
Case 3:
Case 5:
Case 7:
Case 8:
Case:
Case A:
return;
Case 2:
if (isleap)
return;
else return 28;
Default:
Return
}
public static Boolean isleap (int year) {
if (year%4 = = 0 && year%100!= 0)
return true;
Else if (year%100 = = 0 && year%400 = 0)
return true;
else
return false;
public static int fixday (int year,int month) {
int base_year = 1;
Int[] Base_month = {0,0,3,3,6,1,4,0,3,5,0,3,5};
if (isleap (year)) {
base_year++
for (int i = 3; i<=6; i++) {
Base_month[i] + = 1;
if (base_month[i] = = 7) {
Base_month[i] = 0;
}
for (int i = 9; I <= i++) {
Base_month[i] + = 1;
if (base_month[i] = = 7) {
Base_month[i] = 0;
}
}
Return (year+year/4+year/400-year/100-base_year+base_month[month]+1)%7;}
}
Dategrid section:
import Javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.util.*;
public class DateGrid extends JWindow implements ActionListener {
//DateGrid的构造方法
public DateGrid() {
super();
this.design();
}