- 1
- 0
- 约7.27千字
- 约 7页
- 2021-01-19 发布于广东
- 举报
import java.awt.Color; import java.awt.Font; import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.Date;
import java.util.GregorianCalendar; import javax.swing.JButton;
import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel;
public class Calender2 extends JFrame implements ActionListener, ItemListener {
/**
实现简单的日历功能
*
@author Jadie version 1.0 2007/12/29
*
*/
private static final long serialVersionUID = 1L;
public static void main(String args[]) { try {
Calender2 frame = new Calender2(); frame.setVisible(true);
} catch (Exception e) { e.printStackTrace();
}
}
private Date date = new Date();
private GregorianCalendar gregorianCalendar = new GregorianCalendar();
private String[] stringWeek = new String[] { SUN, MON, TUE, WED, THU, FRI, SAT };
private String[] stringWeekCn = new String[] { 星期天, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六 };
private String[] stringMonth = new String[] { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct, Nov, Dec };
private String[] strSysTime = new String[6];
// 存储当前日期信息;private String[] strSysNowTime = new String[6];
// 存储运行时日期信息
private JButton[] buttonDay = new JButton[42]; private JButton[] buttonWeek = new JButton[7];
private JLabel labelMonth = new JLabel(); private JButton buttonToday = new JButton();
private JButton buttonLastMonth = new JButton(); private JButton buttonNextMonth = new JButton(); private JComboBox comboYear = new JComboBox();
private JComboBox comboMonth = new JComboBox(); public Calender2() {
super( 万 年 历 ---156 制 作 ); getContentPane().setLayout(new GridLayout(8, 7, 3, 5));
setBounds(250, 200, 530, 360);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
comboYear.setForeground(new Color(0, 0, 255)); comboYear.setFont(new Font(, Font.PLAIN, 14)); for (int y = 1900; y 2101; y++) {
comboYear.addItem( + new Integer(y).toString());
}
getContentPane()
您可能关注的文档
最近下载
- 2026年菏泽医学专科学校单招综合素质笔试备考题库及答案解析.docx VIP
- 2026年菏泽医学专科学校单招综合素质考试备考题库附答案详解.docx VIP
- 2025年上海期货交易所招聘笔试模拟题及答案.doc VIP
- 人教版六年级下册英语全册教案及反思.doc
- 2025至2030中国预拌混凝土行业细分市场及应用领域与趋势展望研究报告.docx VIP
- 数字信号处理-理论、算法与实现(第三版)胡广书习题解答.docx
- 《技术经济学概论》(第四版) 虞晓芬 第02章 技术创新.ppt VIP
- 优瑞咖啡机说明书优瑞咖啡机说明书.pdf VIP
- 2026年菏泽医学专科学校单招综合素质考试题库及答案解析.docx VIP
- 中西诗在情趣上的比较_朱光潜.pdf VIP
原创力文档

文档评论(0)