文件名称:Java/JSP万年历编写实例.rar
文件大小:14KB
文件格式:RAR
更新时间:2022-07-30 03:29:01
Java源码-系统相关
Java万年历源码, 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[] = {"星期日", "星期一", "星期二", "星期三","星期四", "星期五", "星期六"}; String months[] = {"一月", "二月", "三月", "四月","五月", "六月", "七月", "八月", "九月","十月", "十一月", "十二月"}; int daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //每个月的天数 int searchMonth,searchYear; //查询的年份及月份 public void init(){ setBackground(Color.white); //设置背景颜色 searchMonth = calendar.get(Calendar.MONTH); //得到系统年份 searchYear = calendar.get(Calendar.YEAR); //得到系统月份 add(new Label(" 年:")); //增加组件到Applet tfYear.setText(String.valueOf(searchYear)); //设置文本域文字 add(tfYear); add(new Label(" 月:")); monthChoice.setFont(smallFont); //设置月份选择下拉框的显示字体 for (int i = 0; i < 12; i ) { monthChoice.addItem(months[i]); //增加下拉框选项
【文件预览】:
codesc.net
----Java万年历()
--------CalendarApplet.java(6KB)
--------Calendar.html(165B)
--------43-1.bmp(464KB)
--------CalendarApplet.class(4KB)