桌面精灵毕业设计(论文)word格式.doc

上传人:laozhun 文档编号:4026202 上传时间:2023-04-01 格式:DOC 页数:33 大小:1.77MB
返回 下载 相关 举报
桌面精灵毕业设计(论文)word格式.doc_第1页
第1页 / 共33页
桌面精灵毕业设计(论文)word格式.doc_第2页
第2页 / 共33页
桌面精灵毕业设计(论文)word格式.doc_第3页
第3页 / 共33页
桌面精灵毕业设计(论文)word格式.doc_第4页
第4页 / 共33页
桌面精灵毕业设计(论文)word格式.doc_第5页
第5页 / 共33页
点击查看更多>>
资源描述

《桌面精灵毕业设计(论文)word格式.doc》由会员分享,可在线阅读,更多相关《桌面精灵毕业设计(论文)word格式.doc(33页珍藏版)》请在三一办公上搜索。

1、摘 要三级课题桌面精灵系统,就是为满足需要而开发的,主要包括用户的日历、时钟、生活的琐事、星座奇缘、奇事、精品图书、天气的查询、备忘、日志、计划。从而做事的效率和了解社会时事发展。本系统总共分为6章,第1章讲述了前言概括,第2章系统需求分析,第3章数据库表的概要设计,第4章主要讲述了数据库及程序系统的详细设计,第5章讲述了系统运行及其调示,第6章作为总结,主要写自己的心得体会及做课题当中所遇到的问题,及解决办法,还有附录,本组开发的桌面精灵系统结合实际,合理设置用户的需求并掌握的相应信息。综合地对他们进行数据库的设计、数据库的连接和程序代码的编写,有效的最终在系统运行中得以实现。通过各个信息模

2、块的设计,可以详细地进行各个小的方面的内容实现,做到各个信息环节的内容最终都能够在程序中得到实现,使操作成员能明了的了解桌面精灵这个系统。关键词:Java ;桌面精灵系统;数据库的设计;目录摘 要3第1章前言5第2 章 需求分析62.1 功能需求62.2编译环境需求72.3界面需求72.4系统主要模块分析7第3章 表概要设计93.1数据库概要设计93.1.1 实体及其属性93.1.2 E-R图93.2 系统管理模块设计11第4章 详细设计11.主页面实现如图-124.数据库表内容及实现144.页面的设计17第5章 调试30第6章 结束语36致谢:38指导教师评语39附录A:桌面精灵程序设计40

3、1.主页面程序402.日历程序41.时钟程序44.计划程序46页程序48第1章 前言三级课题桌面精灵系统能够提供用户操作平台,,方便用户对日常生活的管理和增加一些对哲、历、文学等多方面的提高,认识本程序的内部的数据库的结构和调用方法,以为程序设计人员和软件维护人员更好的编制、测试程序和维护软件的正确运行提供依据。数据库设计的第一步是明确数据库的目的,用来记录信息和管理信息,通过各种表的设计,实现对表的整体调用。详细设计主要关于经常使用的一些功能,还有一些经常性动作。本系统属于团队开发系统,每个人负责不同的模块,实现相应的功能,以求得系统的完整,通过多次的调试和组合并进行相应的修改,并进行相应的

4、交流达成共识在老师指导下使得系统逐步完善,并进行了近一步的调整使系统更趋向于人性化和合理化。最后通过写结束语来完成最后的系统文件,还可以另外附上表和程序来完成整个系统。第2 章 需求分析2.1 功能需求通过对桌面精灵系统的了解,我们可以更清楚的知道更多的详细信息,知道一些备忘、计划、日志、天气等信息,从而对自己进行相应的调整,系统应有的功能模块如下:主页面模块;(独立完成)计划、日历、时钟;(独立完成)备忘;日志;其它一些功能;(共同参与)1 主页面打开页面以后,可以浏览所有可以实现的功能,而且一目了然,对全局有全面的了解。2 添加日历可以在点击按钮后,在工作台出现一个可爱的小日历,并且可以找

5、到自己喜欢的日子,而且一目了然知道每月的天数。使自己的页面更加完美。3 备忘可以对自己近期所要做的事进行一切相应的记录,并且还可以设置是否对相应的事情提醒否,并且还可以进行相应的修改,还可以对过时的进行相应的删除,完成一切相应的操作。增、删、改、查都可以增加操作的随意性。4 天气查询天有不测风云,所以出门之时了解天气对自己是福,不是祸,还可以对其它自己喜爱的地方进行相应的天气查询,从而了解世界。收获更多。5 时钟添加一个时尚而个性的时钟,可以增加桌面的完美性,并且对时间更具体的了解,从而增加自己的做事效率。6 计划对自己将要做的某些事做一些预先的打算,并且再需要的时候还可以进行相应的修改,从而

6、对自己更有利,并且更势时性。增、删、改、查都可以增加操作的随意性。7 日志记录自己的点点滴滴,并且非常实用,而且对自己的美好的回忆,温存又加深印像。增、删、改、查都可以增加操作的随意性。8 菜单其它项可以进行相应的选择,连接相应的网页,从而找到自己的需求,了解更多从而丰富自己的一些常识。2.2编译环境需求本系统使用的开发语言是Java,数据库采用的是My SQL,以Windows XP系统为操作平台。2.3界面需求对于一个好的软件系统有一个友好的界面是很重要的,在设计界面时在给人以美感的同时,界面还应尽量做的简单、功能清晰明了,最大限度地为用户提供操作方便。2.4系统主要模块分析三级课题桌面精

7、灵系统包括多方面内容,进行相应的操作,并得到相应的信息来满足需要,对一些信息进行查询、添加、修改、删除,能够更好的了解一些信息。系统主要模块分析关系图如图2.1所示桌面精灵添加日历查询天气时钟精品图书星座奇缘奇事计划备忘专业哲学经济军事古典小说日志历史今天生活窍门故事音乐查看写日志ife世间百态奇异现象添加检索爱情武侠玄幻第3章 表概要设计3.1数据库概要设计作为系统的重要重要组成部分,数据库设计需要进行各种实体及他们的属性描述,这样,在下面的描述详细设计时,在本章可以看到系统设计的大致设计框架。3.1.1 实体及其属性整个系统各实体可以用以下关系来表示:plan(id,data,time,s

8、ubjects,details);memos(id,data,time,warns,them,contant);logdata(riqi,shijian,zhuti,neirong);注:斜字体为表的主键3.1.2 E-R图E-R图分析的目的是确定系统中所有实体、实体的属性及实体之间的联系,为设计数据库表结构打下基础。画E-R图通常使用自底向上的设计方法,首先对局部视图进行分析设计,然后再将局部视图合并,消除冲突和冗余,得到系统的总体E-R图。这里两表不存在联系,所以对每一表进行单一的描述。计划表如图:planidtimesubjectsdatadetails备忘表如图:memosiddata

9、timewarnsthemcontant日志表如图:logdatariqishijianzhutineirong3.2 系统管理模块设计1. 主页面设计:通过本组讨论, 认为主页面应具有以下功能:显示提供的一些功能,日历添加、时钟、备忘、计划、日志、奇事、精品图书等等。并且通过相应的操作。2. 备忘、计划、日志没计: 数据库完成相应的增、删、改、查,并且设置相应的方法实现一些共用或者通用的方法,去解决这些复杂而繁琐的问题。并且具体可以完成某些特定功能。从而使程序完美而且更加实用。天气、星座奇缘、精品图书、奇事、ife设计:对于一些时事变化比较快的,我们可以采用网页的方式,打开相应的网页,从而查

10、找相应的结果。时钟、日历设计:通过相应的精确判断得到机器的相应时间,从而使页面更加灵活多变,并且可以进行的时间运算,从而知道不久的日期。第4章 详细设计我们采取模块化设计思想,通过各模块的不同组合以实现不同的查询功能。最终,使系统具有内容规范、信息完整、查询便捷等特点。.主页面实现如图-关键代码:1.托盘的实现:public void init() if (SystemTray.isSupported() / 如果操作系统支持托盘this.tray();this.setSize(300, 320);this.setResizable(false);/ 窗口关闭时触发事件addWindowLis

11、tener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0);public void windowIconified(WindowEvent e) try tray.add(trayIcon); / 将托盘图标添加到系统的托盘实例中/setVisible(false); / 使窗口不可视dispose();/释放由此 Window、其子组件及其拥有的所有子组件所使用的所有本机屏幕资源 catch (AWTException ex) ex.printStackTrace(););private

12、void tray() tray = SystemTray.getSystemTray(); / 获得本操作系统托盘的实例ImageIcon icon = new ImageIcon(getClass().getResource(image/4.jpg); / 将要显示到托盘中的图标PopupMenu pop = new PopupMenu(); / 构造一个右键弹出式菜单MenuItem show = new MenuItem(打开程序(s);MenuItem exit = new MenuItem(退出程序(x);pop.add(show);pop.add(exit);trayIcon =

13、 new TrayIcon(icon.getImage(), 桌面精灵, pop);/* 添加鼠标监听器,当鼠标在托盘图标上双击时,默认显示窗口*/trayIcon.addMouseListener(new MouseAdapter() public void mouseClicked(MouseEvent e) if (e.getClickCount() = 2) / 鼠标双击tray.remove(trayIcon); / 从系统的托盘实例中移除托盘图标setExtendedState(JFrame.NORMAL);setVisible(true); / 显示窗口toFront(););s

14、how.addActionListener(new ActionListener() / 点击“显示窗口”菜单后将窗口显示出来public void actionPerformed(ActionEvent e) tray.remove(trayIcon); / 从系统的托盘实例中移除托盘图标setExtendedState(JFrame.NORMAL);setVisible(true); / 显示窗口toFront(););exit.addActionListener(new ActionListener() / 点击“退出演示”菜单后退出程序public void actionPerform

15、ed(ActionEvent e) System.exit(0); / 退出程序);.菜单:planLogMenuBar1 = new JMenuBar();setJMenuBar(planLogMenuBar1);planMenu1 = new JMenu();planLogMenuBar1.add(planMenu1);planMenu1.addSeparator();planMenu1.setText(计划);planMenuItemAdd = new JMenuItem();planMenu1.add(planMenuItemAdd);planMenuItemAdd.setText(u

16、6dfbu3000u52a0);planMenuItemAdd.addActionListener(new ActionListener()public void actionPerformed(ActionEvent e)append.main(););其它菜单里的内容如上一样的加入。.按钮:calendarButton = new JButton();calendarButton.setBackground(color);getContentPane().add(calendarButton);calendarButton.setText(u6dfbu52a0u65e5u5386(C);c

17、alendarButton.setMnemonic(c);calendarButton.setBounds(17, 46, 110, 40);calendarButton.addActionListener(new ActionListener()public void actionPerformed(ActionEvent e)calendar.main(););其它按钮与此一样。4.数据库表内容及实现根据上面所说实体与属性,基于功能的分析,可为考虑系统创建库表以便于应用和维护系统,将其中的数据库表设计如下:1.计划表设计如:4-2-12.备忘表设计如:4-2-23.日志表设计如:4-数据库

18、核心代码:static try Class.forName(com.mysql.jdbc.Driver);System.out.println(forName); catch (ClassNotFoundException e) / TODO 自动生成 catch 块e.printStackTrace();public static Connection getConnection()try Connection conn = null;return conn=DriverManager.getConnection(url,user,password); catch (SQLException

19、 e) / TODO 自动生成 catch 块System.out.println(返回Connection错误);e.printStackTrace();System.out.println(Hello);return null;public static void free(Connection conn,Statement st,ResultSet re)try re.close(); catch (SQLException e) / TODO 自动生成 catch 块e.printStackTrace();finallytry st.close(); catch (SQLExcepti

20、on e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();public static void free(Connection conn,Statement st)try st.close(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();public static void free(Co

21、nnection conn,PreparedStatement pr)try pr.close(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();public static void free(Connection conn,PreparedStatement pr,ResultSet re)try re.close(); catch (SQLException e) e.printStackTrace();final

22、lytry pr.close(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) / TODO 自动生成 catch 块e.printStackTrace();4.页面的设计.主页面:日历:核心代码:static Calendar today = Calendar.getInstance();YEAR = year = today.get(Calendar.YEAR);MONTH = month = today.get(Calendar.MONTH) + 1;

23、DAY = today.get(Calendar.DAY_OF_MONTH);ToDiecedLeapYear();static void ToDiecedLeapYear()if (year % 100 = 0) daysOfMonth2 = (year % 400 = 0 ? 29 : 28); else daysOfMonth2 = (year % 4 = 0 ? 29 : 28);DateFormat dateFormat = DateFormat.getDateInstance();/日期/时间格式try dateFormat.parse(year + - + month + -1)

24、; catch (ParseException e) e.printStackTrace();Calendar firstDayOfMonth = dateFormat.getCalendar();/得到第一天int dayOfWeek = firstDayOfMonth.get(Calendar.DAY_OF_WEEK) - 1;System.out.println(dayOfWeek);if (dayOfWeek = 0) dayOfWeek = 7;int lastMonthDays = 31;if (month 2) lastMonthDays = daysOfMonthmonth -

25、 1;System.out.println(lastMonthDays - dayOfWeek+2);for (int day = lastMonthDays - dayOfWeek + 2; day = lastMonthDays; day+)button = new CalendarButton(day);button.setEnabled(false);/设置按钮不能被调用tableModel.setValueAt(button,row,col);if (col = 6) row+;col = 0; else col+;/ 当月for (int day = 1; day 4) if (c

26、ol = 5) button.setForeground(Color.GREEN); else button.setForeground(Color.orange);if (day = DAY) if (year = YEAR & month = MONTH) button.setForeground(Color.RED);tableModel.setValueAt(button, row, col);if (col = 6) row+;col = 0; else col+;/ 下一月int nextMonthDays = 42 - (row * 7 + col);for (int day =

27、 1; day = nextMonthDays; day+) button = new CalendarButton(day);button.setEnabled(false);tableModel.setValueAt(button, row, col);if (col = 6) row+;col = 0; else col+;时钟:核心代码:try Thread.sleep(1000);seconds+;if(seconds 10)if(minuter 10 )if(hour 10)clockLabel.setText(0+hour+:+0+minuter+:+0+seconds);clo

28、ckLabel.setBackground(Color.red);elseclockLabel.setText(hour+:+0+minuter+:+0+seconds);clockLabel.setBackground(Color.red);else if(hour =60)seconds =0;minuter+;if(minuter10)if(hour =60)minuter = 0;hour+;if(hour =24)hour=0;clockLabel.setText(0+hour+:+0+minuter+:+0+seconds);clockLabel.setBackground(Col

29、or.red);else clockLabel.setText(hour+:+0+minuter+:+0+seconds);clockLabel.setBackground(Color.red);else if(hour 10)clockLabel.setText(0+hour+:+minuter+:+0+seconds);clockLabel.setBackground(Color.red);elseclockLabel.setText(hour+:+minuter+:+0+seconds);clockLabel.setBackground(Color.red);else if(minute

30、r 10)if(hour 10)clockLabel.setText(0+hour+:+0+minuter+:+seconds);clockLabel.setBackground(Color.red);elseclockLabel.setText(hour+:+0+minuter+:+seconds);clockLabel.setBackground(Color.red);else if(hour 10)clockLabel.setText(0+hour+:+minuter+:+seconds);clockLabel.setBackground(Color.red);elseclockLabe

31、l.setText(hour+:+minuter+:+seconds);clockLabel.setBackground(Color.red); catch (InterruptedException e) / TODO 自动生成 catch 块e.printStackTrace();JOptionPane.showMessageDialog(null,时钟错误);查询天气:通过调用网络资源核心代码:try Runtime.getRuntime().exec(cmd.exe /c start iexplore +shareWeb); catch (IOException ex) JOption

32、Pane.showMessageDialog(null,网页出错);.计划:.添加:调用数据库并把相应的数据进行处理;核心代码:String arg0 = insert into plan(date,time,subjects,details) values(?,?,?,?) ;Connection conn = PlanData.getConnection();PreparedStatement pr = null;try pr = conn.prepareStatement(arg0);pr.setString(1,dX.getDate();pr.setString(2,dX.getTim

33、e();pr.setString(3,dX.getTextName();pr.setString(4,dX.getTextArea();pr.executeUpdate();return true; catch (SQLException e) / TODO 自动生成 catch 块e.printStackTrace();finallyPlanData.free(conn,pr);return false;.检索:对检索到的数据进行相应的操作:核心代码:public PlanObject find(String textName)String arg0 = select * from plan

34、 where subjects = ?;Connection conn = PlanData.getConnection();PreparedStatement pr = null;ResultSet re = null;PlanObject dX = new PlanObject();try pr = conn.prepareStatement(arg0);pr.setString(1,textName);re = pr.executeQuery();if(re.next()System.out.println(Next);number = re.getInt(id);dX.setDate(

35、re.getString(2);dX.setTime(re.getString(3);dX.setTextName(re.getString(4);dX.setTextArea(re.getString(5);return dX; catch (SQLException e) / TODO 自动生成 catch 块e.printStackTrace();finallyPlanData.free(conn,pr,re);return null;public void deletedData(String textName)String arg0 = delete from plan where

36、subjects = ? ;Connection conn = PlanData.getConnection();PreparedStatement pr = null;PlanObject dX = new PlanObject();try pr = conn.prepareStatement(arg0);pr.setString(1,textName);pr.executeUpdate(); catch (SQLException e) e.printStackTrace();finallyPlanData.free(conn,pr);public void deletedData()St

37、ring arg0 = delete from plan where id = ? ;Connection conn = PlanData.getConnection();PreparedStatement pr = null;try pr = conn.prepareStatement(arg0);pr.setInt(1,number);pr.executeUpdate(); catch (SQLException e) e.printStackTrace();finallyPlanData.free(conn,pr);public void update(PlanObject dX)Str

38、ing arg0 = update plan set date = ? , time = ?, subjects = ?,details = ? where id = ? ;Connection conn = PlanData.getConnection();PreparedStatement pr = null;try pr = conn.prepareStatement(arg0);pr.setString(1, dX.getDate();pr.setString(2,dX.getTime();pr.setString(3, dX.getTextName();pr.setString(4,

39、dX.getTextArea();pr.setInt(5,number);pr.executeUpdate(); catch (SQLException e) / TODO 自动生成 catch 块e.printStackTrace();finallyPlanData.free(conn,pr);备忘:日志:8星座奇缘、精品图书、奇事、ife:以上是对网页过行相应的操作不在一一列举核心代码:try Runtime.getRuntime().exec(cmd.exe /c start iexplore +shareWeb); catch (IOException ex) JOptionPane.showMessageDialog(null,网页出错);第5章 调试通过系统的运行,可以适当地对信息进行各种操作:首先进入主页面,然后进行相应的操作,并对操作做出相应的回应。如果主题为空出现提示:如果计划内容为空:以上只对部分功能进行调试,仅供参考

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号