Java万年历final.doc

上传人:hs****ma 文档编号:560033511 上传时间:2024-02-23 格式:DOC 页数:14 大小:203.50KB
返回 下载 相关 举报
Java万年历final.doc_第1页
第1页 / 共14页
Java万年历final.doc_第2页
第2页 / 共14页
Java万年历final.doc_第3页
第3页 / 共14页
Java万年历final.doc_第4页
第4页 / 共14页
Java万年历final.doc_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《Java万年历final.doc》由会员分享,可在线阅读,更多相关《Java万年历final.doc(14页珍藏版)》请在金锄头文库上搜索。

1、The Java task - graphical calendar Name:XiaotongYangBTEC-11222132012/5/25CatalogCatalog21. Structured programming31.1 Structured programming principle31.2 Structured programming features31.3 Structured programming32. Calendar design42.1 Structure design4(1) File structure design4(2) The design of da

2、ta structure42.2 The perpetual calendar function design5(1) Overall function design and process5(2) Each module function design and flow5(3) User interface design63. Production of the calendar73.1 Procedures used in the control structure is introduced73.2 Procedures for the various functions and par

3、ameters73.3 Program all the code74. The production process problems and Solutions135. Calendar of the algorithms and theory146. Summary and evaluation151. Structured programming1.1 Structured programming principle It uses a subroutine, code blocks ( English: block structures ), for cycle and while c

4、ycle structure, to replace the traditional goto. Hoping to improve computer program clarity, quality and development time, and avoid to write spaghetti code.1.2 Structured programming features Structured programming must be the function of the system of rational analysis, decomposition and synthesis

5、, so the related personnel requirements higher, in addition, when using a structured programming method, the need for data management.1.3 Structured programming Structured programming structured programming theory as theoretical basis, structured programming theory mentions the use of sequential, se

6、lection and repeat the three assembly programming way, can be said that all computable functions. The three structure is sufficient to express CPU instruction cycle, can also mean that the Turing machine operation, this point of view, the processor executes the instruction can be seen as a structure

7、d programming, although the program may not be a structured programming. Generally considered the structured programming theory is attributed to Boehm and Jaakko Pini in 1966published papers, one reason may be that Dykstra quoted in this paper. Structured programming theory without mention of how to

8、 write a structured program, there is no mention of structured program analysis, then1960 to1970in the 1970s, Deckard Stella, Robert Floyd, Tony Hall and other computer scientists in this field have many contributions.2. Calendar design2.1 Structure design(1) File structure designComponent window, b

9、utton, text box, select box, scroll bars, query the event processing and date calculation(2) The design of data structuresearchMonth = calendar.get (Calendar.MONTH);searchYear = calendar.get(Calendar.YEAR);tfYear.setText (String.valueOf (searchYear);for(int i = 0; i 12; i +)monthChoice.addItem (mont

10、hs i );/增加下拉框选项g.setColor (color.lightGray);/设置当前颜色g.setFont (bigFont);/设置当前使用字体g.drawString (searchYear+”年”, 60, TOP+70);/绘制字符串g.drawString (searchMonth + 1) +”月”, 200, TOP + 130);For (int I = 0; I = totalWidth; I += CELLWIDTH)g.drawLine (i, TOP, i, TOP +totalHeight);2.2 The perpetual calendar func

11、tion design(1) Overall function design and process I design calendar year and the month to enter the query, click the update button, you can get the corresponding calendar. Its convenient for the user s query. This calendar is the graphical user interface of the calendar. The main process is the int

12、erface design, query the event processing and date calculation.(2) Each module function design and flow Query and display part: The query input portion includes a text field, for the input year , a selected drop-down box, used to select month , an update button, to start querying the event. Query ev

13、ent processing part: Event target attribute can be the event source, it is used with button example are compared, can know the time is derived from the button.After the incident, respectively, call the getText method and getSelectedIndex method from the year and month selector input text field drop-

14、down box to obtain query of the year and the month. Note that, from the text field of the results obtained for the string, you need to call the Integer classs parseInt method to convert it to an integer value.The GregorianCalenda class time is calculated from the beginning of 1581, when the user inp

15、uts a time earlier than the time, need to handle. Program first calls the repaint method to redraw the screen, put the date information display. The date of calculation section: Date of the calculation includes mainly calculate every year the first day and the first day of the month.(3) User interface design The interface is mainly composed of two parts - the query input portion and a display part. The query input portion having a se

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号