}
public static String getchina(int day){ String a = \ if(day==10) return \初十\
int two = (int)((day)/10); if(two==0) a = \初\ if(two==1) a = \十\ if(two==2) a = \廿\ //if(two==2) // a = \卅\
int one = (int)(day); switch(one){
case 1:a += \一\ case 2:a += \二\ case 3:a += \三\ case 4:a += \四\ case 5:a += \五\ case 6:a += \六\ case 7:a += \七\ case 8:a += \八\ case 9:a += \九\ }
return a; } //
传
出
y
年
m
月
d
日
对
应
的
历.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5 .isLeap6
public static String shower() { String b=\
ACalendar Calend =new ACalendar(); //int year = Calend.getYear(); //int month = Calend.getMonth()+1; //int day = Calend.getDay();
农
int year=Integer.parseInt(ACalendar.strbuttonyear); int month=Integer.parseInt(ACalendar.strbuttonmonth); int day=Integer.parseInt(ACalendar.strbuttonday)+1; String week = \
long[] l = calElement(year,month,day); switch(Calend.getWeek()){ case 1:week = \日\ case 2:week = \一\ case 3:week = \二\ case 4:week = \三\ case 5:week = \四\ case 6:week = \五\ case 7:week = \六\ }
String n = \
switch((int)(l[1])){ case 1:n=\一\ case 2:n=\二\ case 3:n=\三\ case 4:n=\四\ case 5:n=\五\ case 6:n=\六\ case 7:n=\七\ case 8:n=\八\ case 9:n=\九\ case 10:n=\十\ case 11:n=\十一\ case 12:n=\十二\ } try {
b =\农历\月\ BufferedWriter
outout = new BufferedWriter(new
FileWriter(\
outout.close();
} catch (Exception e) {e.printStackTrace();}
return b; } }
这里主要是用来公历与农历相匹配,以便在给定的一天能够显示出相应的农历日期。
PoliceListen.java //日历的按钮鼠标监听 import java.awt.event.*;
public class PoliceListen implements MouseListener { public static int x,y;
public void mousePressed(MouseEvent e) { }
public void mouseReleased(MouseEvent e) { }
public void mouseEntered(MouseEvent e) { }
public void mouseExited(MouseEvent e) { }
public void mouseClicked(MouseEvent e) {
if(e.getClickCount()>=1&&MyWindowListener.mark==0){ } }
public void second(){ Test win2=new Test(); MyWindowListener.mark++; } }
这里主要是用来给日历上相应的按钮加监听,使点击弹出备忘记事的窗口。
x=e.getX();
y=e.getY(); second();
相关推荐: