자바(java)로 만든 디지털시계(DigitalClock)
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
해당 자료는 2페이지 까지만 미리보기를 제공합니다.
2페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

자바(java)로 만든 디지털시계(DigitalClock)에 대한 보고서 자료입니다.

목차

Clock.class
Clock.java
DigitalClockViewer.class
DigitalClockViewer.java
SegmentComponent.class
SegmentComponent.java

15.3KB

본문내용

import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JComponent;

/**
* A component that draws current time like digital clock.
*/
public class SegmentComponent extends JComponent implements Runnable {

    Thread th;
    Clock now = new Clock();

    /**
     * Constructs a SegmentComponent with a given number user entered.
     *
     * @param number
     * the number user entered of 0 to 9
     */
    public SegmentComponent() {
        th = new Thread(this);
        th.start();
    }

    // Construct seven segment and draw to match the number

    // When the number user entered is 0.
    public void zero(Graphics2D g2, int x) {
        a(g2, x);
        b(g2, x);
        c(g2, x);
        d(g2, x);
        e(g2, x);
        f(g2, x);
    }

    // When the number user entered is 1.
    public void one(Graphics2D g2, int x) {
        b(g2, x);
        c(g2, x);
    }

    // When the number user entered is 2.
    public void two(Graphics2D g2, int x) {
        a(g2, x);
        b(g2, x);
        g(g2, x);
        e(g2, x);
        d(g2, x);
    }

    // When the number user entered is 3.
    public void three(Graphics2D g2, int x) {
        a(g2, x);
        b(g2, x);
        g(g2, x);
        c(g2, x);
        d(g2, x);
    }
  • 가격1,000
  • 페이지수6페이지
  • 등록일2014.01.11
  • 저작시기2013.9
  • 파일형식압축파일(zip)
  • 자료번호#901782
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니