云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > Java课程设计实验报告及全部源码流程图

Java课程设计实验报告及全部源码流程图

  • 62 次阅读
  • 3 次下载
  • 2025/6/24 5:52:49

}

public void menuSelected(MenuEvent e) { Test.delete.setVisible(true);

Test.change.setVisible(true); Test.text1.setVisible(true); Test.text2.setVisible(false); Test.yes.setVisible(false);

Test.sldday.setVisible(false);

Test.yearbox.setVisible(false); Test.yearlabel.setVisible(false); Test.monthbox.setVisible(false); Test.monthlabel.setVisible(false); Test.daybox.setVisible(false); Test.daylabel.setVisible(false); Test.sldtime.setVisible(false); Test.hourbox.setVisible(false); Test.mhlabel.setVisible(false); Test.minutebox.setVisible(false);

String

year,month,day,hour,minute,text3length,filename,read_str;

year=Test.yearbox.getSelectedItem()+\

Test.cancel.setVisible(false); Test.text3.setVisible(false);

Test.yearbox.setSelectedItem(ACalendar.strbuttonyear);

Test.daybox.setSelectedItem(ACalendar.strbuttonday); Test.hourbox.setSelectedItem(Test.strhour); Test.minutebox.setSelectedItem(Test.strminute);

Test.monthbox.setSelectedItem(ACalendar.strbuttonmonth);

month=Test.monthbox.getSelectedItem()+\day=Test.daybox.getSelectedItem()+\hour=Test.hourbox.getSelectedItem()+\

minute=Test.minutebox.getSelectedItem()+\filename = year+month+day; Test.text1.setText(\ try {

FileReader fr = new FileReader(filename+\读取文 BufferedReader bfr = new BufferedReader(fr);//将文件内容读到缓存区

boolean flag=false;//旗标

while((read_str = bfr.readLine())!=null) // 每次读取一行,直到结束

{

if (flag)//从第二行开始每一行第一个位置加入断行 Test.text1.append(\ Test.text1.append(read_str); flag=true; }

fr.close();

}catch(FileNotFoundException evt) {

}catch(IOException evt) {

evt.printStackTrace(); } } }

这里主要用来设置备忘录窗口中今日待办菜单的监听事件,使之选择菜单能够显示选定日期的备忘记事、相关功能按钮,当未选择时,隐藏相关功能按钮与记事。

MyWindowListener.java //窗口监听

import javax.swing.*; import java.awt.*; import java.awt.event.*;

public class MyWindowListener extends WindowAdapter {

static int mark=0;

public void windowClosing(WindowEvent e)//窗口正处在关闭后调用

{

mark--; } }

此处主要是监听备忘录窗口的关闭与否,并根据关闭来对其进行标记,使得再点击按钮时出现窗口,出现窗口后再点击就失效,而关掉后再次点击又会重新出现。

NongLi.java import java.io.*; import java.util.*; public class NongLi {

final static long[] lunarInfo=new long[] {

0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,

0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,

0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,

0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,

0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,

0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a

8,0x0e950,0x06aa0,

0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,

0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,

0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,

0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,

0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,

0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,

0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,

0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,

0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0};

final public static int lYearDays(int y)//====== 传回农历 y年的总天数

{

int i,sum = 348;

for(i=0x8000; i>0x8; i>>=1) {

if ((lunarInfo[y-1900] & i)!=0) sum+=1; }

return(sum+leapDays(y)); }

final public static int leapDays(int y)//传回农历 y年闰月的天数 {

if(leapMonth(y)!=0) {

if ((lunarInfo[y-1900] & 0x10000)!=0) return 30; else return 29; }

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

} public void menuSelected(MenuEvent e) { Test.delete.setVisible(true); Test.change.setVisible(true); Test.text1.setVisible(true); Test.text2.setVisible(false); Test.yes.setVisible(false); Test.sldday.setVisible(false); Test.yearbox.setVisible(false); Test.yearlabel.setVisible(false); Test.

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com