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:JComboBox
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++) {