- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java日历时钟小程序
java日历时钟小程序
Java时钟程序,按类粘贴至编译器编译即可使用。
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JButton;
public class Calendar1 extends JPanel implements ActionListener{
JLabel[] daylabel=new JLabel[49];
JLabel lYear=new JLabel("年");
JLabel lMonth=new JLabel("月");
JLabel lback=new JLabel("背景色");
JButton retu=new JButton("返回");
Date nowdate=new Date();
int month=0;
String year=null;
String back=null;
int nowyear=nowdate.getYear()+1900;
int nowmonth=nowdate.getMonth();
boolean bool=false;
JComboBox comboboxyear=new JComboBox();
JComboBox comboboxmonth=new JComboBox();
JComboBox comboboxback=new JComboBox();
JPanel pYearMonth=new JPanel();
//JPanel pMonth=new JPanel();
JPanel pDay=new JPanel();
//JPanel panel=new JPanel();
Calendar c=Calendar.getInstance();
Calendar1(){
//super("日历");
comboboxback.addItem("默认");
comboboxback.addItem("红粉");
comboboxback.addItem("黑夜");
for(int i=nowyear-10;i<nowyear+20;i++) comboboxyear.addItem(i+""); for(int i=1;i<13;i++)
comboboxmonth.addItem(i+""); comboboxyear.setSelectedIndex(10); pYearMonth.add(new JLabel(" ")); pYearMonth.add(comboboxyear);
pYearMonth.add(lYear);
comboboxmonth.setSelectedIndex(nowmonth); pYearMonth.add(comboboxmonth); pYearMonth.add(lMonth);
pYearMonth.add(new JLabel(" ")); pYearMonth.setBackground(Color.PINK); pYearMonth.setForeground(Color.red); comboboxback.setSelectedItem("默认"); pYearMonth.add(new JLabel(" ")); pYearMonth.add(comboboxback);
pYearMonth.a
您可能关注的文档
- IECP — an approach for integrated environmental and cost evaluation of process design alternatives and its application to evaluate different NOx prevention technologies in a 125 MW thermal power plant.pdf
- Insurance companies increase premium for hydropower plants:保险公司提高保费的水电厂.docx
- Intra-pancreatic Distal Bile Duct Carcinoma is Morphologically, Genetically, and Clinically Distinct from Pancreatic Duc.Intra-pancreatic远端胆管癌形态,从胰腺导管腺.pdf
- hiyou产品App端需求文档v1.0-2013-4-15(最终定稿) - 副本.pdf
- Investment Policy - Griffith University:投资策略-格里菲斯大学.docx
- IPO项目尽职调查文件清单.doc
- java俄罗斯方块报告 《Java程序设计》实训报告——俄罗斯方块.doc
- java时钟程序(Java clock program).doc
- JAVA俄罗斯方块实训报告.doc.doc
- java程序设计-时钟.doc
- 一病一品护理汇报(手工精品图文).ppt
- 国家义务教育质量监测四年级心理健康测试卷3+问卷(通用版附答案).docx
- 国家义务教育质量监测四年级心理健康测试卷2+问卷(通用版附答案).docx
- 国家义务教育质量监测四年级心理健康测试卷5+问卷(通用版附答案).docx
- 国家义务教育质量监测四年级心理健康测试卷1+问卷(通用版附答案).docx
- 国家义务教育质量监测四年级心理健康测试卷4+问卷(通用版附答案).docx
- 13(猫)第3课时 课件+公开课一等奖创新教学设计.docx
- 孙权劝学 (同步公开课一等奖创新教学设计).docx
- 第17课 要是你在野外迷了路 公开课一等奖创新教学设计.docx
- 统编版(五四制)11古诗二首 池上 公开课一等奖创新教学设计.docx
文档评论(0)