자바 GUI로 구현한 다이어리(소스코드, 보고서 포함)
본 자료는 6페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
해당 자료는 6페이지 까지만 미리보기를 제공합니다.
6페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

자바 GUI로 구현한 다이어리(소스코드, 보고서 포함)에 대한 보고서 자료입니다.

목차

1. 프로그램 개요
2. 설계
3. 소스코드

실행켭쳐
삭제버튼누를시
수정을 눌러서 스케줄들이 저장되 있는 공간

본문내용

는지 확인 스트링
String ScheDule=\"\";
DAY = ((JButton) e.getSource()).getText();
updateSchedule();
TextArea_Memo.setText(\"\");
FileInputStream fis;
try {
filename=YEAR+MONTH+DAY+\".txt\";
for(int i = 0; i < filelist.length; i++)
{
if(filelist[i].getName().compareTo(filename)==0) //파일안에 같은 그날에 저장된 파일이 있을경우만 파일을 읽어옴
{
fis = new FileInputStream(filename);
BufferedReader buf = new BufferedReader(new InputStreamReader(fis));
while((str=buf.readLine())!=null)
ScheDule+=str;//널일때까지 받아서 내용을 갱신
TextArea_Memo.setText(ScheDule);
buf.close();
}
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
public void stateChanged(ChangeEvent e) //년바꾸는 리스너
{
JSpinner obj = (JSpinner)e.getSource();
Integer y = (Integer)obj.getValue();
int year = y.intValue();
jcalendar.setCalendar(year, jcalendar.getMonth(), 1);
YEAR=Integer.toString(year);
updateCalendar();
}
public void updateCalendar() //날짜를 갱신하는 함수
{
if (jcalendar.FirstdayOfWeek() == 0)
{
jcalendar.setFirstdayOfWeek(7);
}
for (int i = 0; i < jcalendar.FirstdayOfWeek(); i++)
{
dateListBtn.get(i).setText(\"\");
}
for (int i = 0; i < jcalendar.Lastday(); i++)
{
dateListBtn.get(jcalendar.FirstdayOfWeek() + i).setText(i + 1 + \"\");
}
int afterEmpty = jcalendar.FirstdayOfWeek() + jcalendar.Lastday();
int last = dateListBtn.size() - afterEmpty;
for (int i = 0; i < last; i++)
{
dateListBtn.get(afterEmpty + i).setText(\"\");
}
WeekendColor();
DatePanel.updateUI();
}
public void WeekendColor() //토요일과 일요일을 버튼 색깔을 넣는 함수
{
for (int i = 0; i < dateListBtn.size(); i++)
{
if (i % 7 == 0) //일요일이면 빨간색으로
{
dateListBtn.get(i).setForeground(Color.RED);
}
else if (i % 7 == 6) //토요일이면 gray색으로
{
dateListBtn.get(i).setForeground(Color.gray);
}
}
}
void updateSchedule() //메모창에 그날의 맞는 날짜를 띄우는 함수
{
TextArea_Memo.setBorder(new TitledBorder(YEAR+\"년\"+MONTH+\"월\"+DAY+\"일\"+\"스케줄\"));
}
}
JCalendar
import java.util.*;
public class JCalendar
{
private Calendar cal;
private int year; //연
private int month; //월
private int today; //오늘
private int firstdayOfWeek; //1일의 요일
private int lastday; //한달의 최대 날짜
public JCalendar()
{
cal = Calendar.getInstance();
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
today = cal.get(Calendar.DAY_OF_MONTH);
setCalendar(year, month, 1);
}
public void setCalendar(int year, int month, int date) //달력 설정
{
cal.set(year, month, date);
this.year = year;
this.month = month;
firstdayOfWeek = cal.get(Calendar.DAY_OF_WEEK) - 1;
lastday = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
public void setFirstdayOfWeek(int firstdayOfWeek)
{
this.firstdayOfWeek = firstdayOfWeek;
}
public Calendar getCal() {return cal;}
public int FirstdayOfWeek() {return firstdayOfWeek;} //월의 첫번째 날을 갱신
public int Lastday() {return lastday;} //월의 마지막 날을
public int getMonth() {return month;} //월을 갱신
public int getToday() {return today;} //날을 갱신
public int getYear() {return year;} //년을 갱신
}
실행켭쳐
삭제버튼누를시
수정을 눌러서 스케줄들이 저장되 있는 공간
  • 가격3,000
  • 페이지수19페이지
  • 등록일2020.12.08
  • 저작시기2015.3
  • 파일형식한글(hwp)
  • 자료번호#1141703
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니