java source code
import java.applet.Applet;
import java.awt.*;
import java.util.*;
public class CalendarApplet extends Applet{
static final int TOP = 70; //顶端距离
static final int CELLWIDTH=50,CELLHEIGHT = 30; //单元格尺寸
static final int MARGIN = 3; //边界距离
static final int FEBRUARY = 1;
TextField tfYear = new TextField("2011", 5); //显示年份的文本域
//Choice monthChoice = new Choice(); //月份选择下拉框
TextField tfMonth = new TextField("5");
Button btUpdate = new Button("更新"); //更新按钮
GregorianCalendar calendar=new GregorianCalendar(); //日历对象
Font smallFont = new Font("TimesRoman", Font.PLAIN, 15); //显示小字体
Font bigFont = new Font("TimesRoman", Font.BOLD, 50); //显示大字体
String days[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
String months[] = {" ","1", "2", "3", "4","5", "6", "7", "8", "9","10", "11", "12"};