String key=\if(table.containsKey(key)) {
String m=\删除\年\月\日的日志吗?\
int ok=JOptionPane.showConfirmDialog(this,m,\询问\JOptionPane.QUESTION_MESSAGE); if(ok==JOptionPane.YES_OPTION) { try {
FileInputStream inOne=new FileInputStream(file); ObjectInputStream inTwo=new ObjectInputStream(inOne);
table=(Hashtable)inTwo.readObject(); inOne.close(); inTwo.close(); table.remove(key);
FileOutputStream out=new FileOutputStream(file);
ObjectOutputStream objectOut=new ObjectOutputStream(out); objectOut.writeObject(table); objectOut.close(); out.close(); text.setText(null); }
catch(Exception ee)
{ } } } else {
String m=\年\月\无日志记录\
JOptionPane.showMessageDialog(this,m,\提示\} } }
public class CalendarPad extends JFrame implements MouseListener //控制主体框架 {
int year,month,day; Hashtable hashtable; File file;
JTextField showDay[]; JLabel title[]; Calendar calendar; int 星期几;
NotePad notepad=null; Month 负责改变月; Year 负责改变年;