java程序设计万年历
3 详细设计
各模块的功能及程序说明 3.1.初始化组件 import java.applet.Applet; import java.awt.*; import java.util.*; 3.2.初始化数据
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("2004", 5); //显示年份的文本域 Choice monthChoice = new Choice(); //月份选择下拉框 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[] = {"星期日", "星期一", "星期二", "星期三","星期四", "星期五", "