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

2020-04-18 07:13

DrawClockGraphics#x : int#y : int#x0 : int#y0 : int#r : int#h : int#w : int#ords_x : int#ords_y : int#ordm_x : int#ordm_y : int#ordh_x : int#ordh_y : int#hh : int#ord_h : int#ang : double#mm : double#ss : double#ord_m : double#RAD : double = Math.PI/180#set : JButton#icon : Icon+DrawClock()+paint(in g : Graphics)Clock+Clock()JButtonIconJPanelJFrame

备忘录类图:

备忘录部分主要包含Test、PoliceListen、PoliceListen2、MyMenuListener1、Mainwin等类。其中MainWin类主要是用来创建备忘录窗口对象,Test主要定义备忘录相关的组件以及添加相应的监听事件以实现备忘记事的添加、修改、删除等功能。PoliceListen类主要用来定义日历按钮的监听。PoliceListen2主要是用来定义备忘录中添加按钮的监听。MyMenuListener1主要是用来定义今日待办事件监听。

TestJFrame PoliceListen2x:inty:intmousePressed(MouseEvent):voidmouseReleased(MouseEvent):voidmouseEntered(MouseEvent):voidmouseExited(MouseEvent):voidmouseClicked(MouseEvent):voidMouseListener PoliceListenx:inty:intmousePressed(MouseEvent):voidmouseReleased(MouseEvent):voidmouseEntered(MouseEvent):voidmouseExited(MouseEvent):voidmouseClicked(MouseEvent):voidsecond():voidyear:Stringmonth:Stringday:Stringhour:Stringminute:Stringd:Datesdf:SimpleDateFormatstr:Stringstryear:Stringstrday:Stringstrmonth:Stringstrhour:Stringstrminute:Stringx:Stringy:Stringchangeboolean:booleanyesboolean:booleanyearboolean:booleanmonthboolean:booleanmenubar:JMenuBarnong:NongLim:Stringnltext:JTextFieldtoday:JMenuaddbutton:JButtonyes:JButtoncancel:JButtonchange:JButtondelete:JButtonsave:JButtoncancel1:JButtonmusic:JTextFieldtext1:JTextAreatext2:JTextAreatext3:JTextAreasldday:JCheckBoxsldtime:JCheckBoxyearbox:JComboBoxmonthbox:JComboBoxdaybox:JComboBoxhourbox:JComboBoxminutebox:JComboBoxyearlabel:JLabelmonthlabel:JLabeldaylabel:mhlabel:JLabelmenulistener1:MyMenuListener1menulistener2:MyMenuListener2policeListen2:Policelistener2Test()init():voidtext1changedUpdate(DocumentEvent):voidtext1removeUpdate(DocumentEvent):voidtext1insertUpdate(DocumentEvent):voidslddayActionPerformed(ActionEvent):voidsldtimeActionPerformed(ActionEvent):voidtext3changedUpdate(DocumentEvent):voidtext3removeUpdate(DocumentEvent):voidtext3insertUpdate(DocumentEvent):voidcancelActionPerformed(ActionEvent):voidyesActionPerformed(ActionEvent):voidyearboxActionPerformed(ActionEvent):voidmonthboxActionPerformed(ActionEvent):voidtodayActionPerformed(ActionEvent):voidchangeActionPerformed(ActionEvent):voidsaveActionPerformed(ActionEvent):voidcancel1ActionPerformed(ActionEvent):voiddeleteActionPerformed(ActionEvent):void WindowAdapter MyWindowListener mark:intwindowClosing(WindowEvent):void MyMenuListener2mark:booleanmenuCanceled(MenuEvent):voidmenuDeselected(MenuEvent):voidmenuSelected(MenuEvent):void MouseListener MyMenuListener1mark:booleanmenuCanceled(MenuEvent):voidmenuDeselected(MenuEvent):voidmenuSelected(MenuEvent):void

2.程序清单

(要说明程序的功能和程序之间的关系,如程序很多,可以只附主要的程序代码)

OurCalendar.Java

public class OurCalendar{

public static void main(String[] args){ try{

MainWin frame = new MainWin(); }

catch (Exception e){

System.out.print(\

}

}

}

这里主要用来创建日历窗口对象,显示日历主窗口

MainWin.java

public class MainWin extends JFrame implements ActionListener{ //JPanel jP; public MainWin(){ }

public void actionPerformed(ActionEvent e){ }

} 这里主要用来定义日历主窗口类的组件。

ACalendar cal = new ACalendar(); Icon img=new ImageIcon(\JButton time=new JButton(img) setLocationRelativeTo(null); setLocation(100,81);

setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(560,560); setVisible(true); setResizable(false); this.setLayout(null); this.setTitle(\我们的日历\this.add(cal);

cal.setBounds(0,30,560,500); this.add(time);

time.setBounds(250,0,25,25); time.setBorderPainted(false); time.setContentAreaFilled(false); time.addActionListener(this);

time.setContentAreaFilled(false);

Clock ck=new Clock();

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

import static javax.swing.JFrame.*; import java.util.*;

import javax.swing.JFrame.*; import static java.util.Calendar.*;

public class ACalendar extends JPanel implements ActionListener {

public static final String HOUR_OF_DAY = null; //定义

PoliceListen police=new PoliceListen();

static String strbuttonyear,strbuttonmonth,strbuttonday; JTextField Year=new JTextField(); JComboBox Month = new JComboBox(); JLabel TheYear = new JLabel(\年\ JLabel TheMonth = new JLabel(\月\ Date this_date = new Date();

JLabel[] Label_title = new JLabel[7]; JButton[] Button_day=new JButton[42]; JButton Up1=new JButton(\ JButton Down2=new JButton(\ JButton Up2=new JButton(\ JButton Down1=new JButton(\ JButton Today=new JButton(\ String background; JPanel jP;

ImageIcon img=new ImageIcon();

JLabel imgLabel;

JPanel pane_ym = new JPanel(); JPanel pane_day = new JPanel();

int this_year = this_date.getYear() + 1900; int this_month = this_date.getMonth(); boolean bool = false; String year_num = null; int month_num; int week,day;

public String getBG(){

}

public void setBG(String background){ }

this.background=background; return background;

public ACalendar() {

super();

jP=new JPanel(); this.setOpaque(false); //this.setOpaque(false); //设定年月

TheYear.setFont(new TheMonth.setFont(new

Font(\Font(\

华华

文文

隶隶

书书

\\

Year.setFont(new Font(\华文隶书\Month.setFont(new

Font(\

\

pane_ym.setOpaque(false); pane_day.setOpaque(false);

Year.setText(Integer.toString(this_year)); for (int i = 1; i < 13; i++) {


Java课程设计实验报告及全部源码流程图(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:中国医学独立实验室现状及发展前景分析

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: