Home > Back-end >  JAVA for help
JAVA for help

Time:05-13

I want to do a calendar notepad, want to have a log that add a tag, is here to write the background of the change,
But written into all has changed, please advice,

Code:
Public void doMark ()
{
for(int i=0; I{
The date [I] removeAll ();
String s=date [I] getText (). The trim ();
Try
{
Int n=Integer. ParseInt (s);
If (isHaveDailyRecord (n)==1)
{
The date [I] setBackground (Color. Pink);
}
}
The catch (Exception e) {}
}
Calendarpad. Repaint ();
Calendarpad. The validate ();
}

Public int isHaveDailyRecord (int n)
{
String key="" + year +" "+ month +" "+ n.
String dailyFile []=dir. List ();
Int boo=0;
For (int k=0; k{
If (dailyFile [k]. Equals (key + ". TXT "));
{
Boo=1;
break;
}
}
Return the boo;
}
  • Related