★★ Java の宿題ここで答えます Part 52 ★★
■ このスレッドは過去ログ倉庫に格納されています
0372デフォルトの名無しさん
2005/07/15(金) 20:10:58import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class Biorhythm extends Frame{
static int birthYear, birthMonth, birthDay;
static int nowYear, nowMonth, nowDay;
public Biorhythm(){
this.setSize(400,300);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
public void paint(Graphics g){
GregorianCalendar date =
new GregorianCalendar();
nowYear = date.get(Calendar.YEAR);
nowMonth = date.get(Calendar.MONTH)+1;
nowDay = date.get(Calendar.DATE);
calBiorhythm(birthYear, birthMonth, birthDay, nowYear, nowMonth, nowDay,
System.out.println("今日までの生存日数: "+ (calDaysAD(nowYear ,nowMonth, nowDay) - calDaysAD(birthYear,birthMonth,birthDay)));
}
■ このスレッドは過去ログ倉庫に格納されています