java万年历拓展成日志记事?- 百度文库 ر

} } } }

class NotePad extends JPanel implements ActionListener //Ƽ {

JTextArea text;

JButton savemessage,delmessage; Hashtable table; JLabel messagebar; int year,month,day; File file;

CalendarPad calendar;

public NotePad(CalendarPad calendar) {

this.calendar=calendar; year=calendar.getYear(); month=calendar.getMonth(); day=calendar.getDay();; table=calendar.getHashtable(); file=calendar.getFile();

messagebar=new JLabel(\\\\messagebar.setFont(new Font(\messagebar.setForeground(Color.blue);

text=new JTextArea(10,10);

savemessage=new JButton(\־\delmessage=new JButton(\ɾ־\savemessage.addActionListener(this); delmessage.addActionListener(this); setLayout(new BorderLayout()); JPanel pSouth=new JPanel();

add(messagebar,BorderLayout.NORTH); pSouth.add(savemessage); pSouth.add(delmessage);

add(pSouth,BorderLayout.SOUTH);

add(new JScrollPane(text),BorderLayout.CENTER);

}

public void actionPerformed(ActionEvent e) {

if(e.getSource()==savemessage) {

savemessage(year,month,day); }

else if(e.getSource()==delmessage) {

delmessage(year,month,day); } }