[프로그래밍] 자바로 짠 계산기
- 최초 등록일
- 2003.12.07
- 최종 저작일
- 2003.12
- 11페이지/ 압축파일
- 가격 2,500원
소개글
과제로 제출한 자료입니다.
소스도 깔끔하고, 주석도 자세합니다.
목차
실행 화면
에러 처리
전체 소스
본문내용
// 특별 버튼( Backspace, CE, C ) 이벤트 핸들러
class KCalcSpecialHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
if( e.getActionCommand().equals("CE")) {
edtCalc.setText(""); // 현재 화면만 클리어
} else if( e.getActionCommand().equals("C")) {
// 완전 클리어
currentState = 0;
edtCalc.setText("");
} else {
// Backspace : 마지막 한자리를 지운다.
if( edtCalc.getText().length() > 0 )
edtCalc.setText(edtCalc.getText().substring(0, edtCalc.getText().length()-1));
}
}
}
참고 자료
없음
압축파일 내 파일목록
java-calc.hwp