import .*;
import .*;
import .*;
import .*;
class Calendar extends Panel implements Runnable
{
Button nextYear,nextMonth,nextDate,lastYear,lastMonth,lastDate;
TextField year,month,date;
AudioClip audioClip;
Thread clock;
Date today;
String[] weekName={"日","一","二","三","四","五","六"};
String[] monthName={"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"};
int[] weekColor={0xff0000, 77ee, 77ee, 77ee, 77ee, 77ee, 0x7795c};
Calendar(AudioClip au)
{
today=new Date();
setLayout(new FlowLayout(,3,13));
add(lastYear=new Button("-"));
add(year=new TextField ((1900+()),2));
add(nextYear=new Button("+"));
add(lastMonth=new Button("-"));
add(month=new TextField((()+1),1));
add(nextMonth=new Button("+"));
add(lastDate=new Button("-"));
add(date=new TextField((()),1));
add(nextDate=new Button("+"));
audioClip=au;
}
public void run()
{
long start=();
do
{
repaint();
start+=1000;
try
{
((0,start-()));
}
catch(InterruptedException e){}
}while(true);
}
public void paint(Graphics g)
{
update(g);
}
public void update(Graphics g)
{
Dimension dimension=size();
Image image=createImage(dimensi
万年历Java代码[1] 来自淘豆网m.daumloan.com转载请标明出处.