Programming Java

posted by .

I have to create an analog clock..What methods should i use

  • Programming Java -

    You might try some of the following links:

    http://search.yahoo.com/search?fr=mcafee&p=using+programming+Java%2C+crate+an+analog+clock

    Sra

  • Programming Java -

    It is a very interesting problem, regarding time (clock).

    First, most computers use local time, which in general is related to universal time (commonly called GMT) with a number of hours of difference.

    If you are contented with a clock that has the seconds hand moving every second, you may consider the "Timer" class, which allows you to start the clock and have a call to a given method regularly thereafter, a second, or a minute, etc.

    If you want to completely synchronize with the computer clock, you may be better off using the Calendar class, which allows you to count the number of milliseconds since January 1st, 1970, and move the hands accordingly.

    Of course, you would require to draw the clock and the hands. Depending on your ambition, you could draw the hands with a simple arrow, or with a width, etc. You can handle all these using the java.awt.graphics class.

    There are plenty of examples on the net, the following is one example:
    http://leepoint.net/notes-java/examples/animation/50analogclockbuf/analogclockbufexample.html
    Try to dig up others and compare the methods each one uses.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. java programming

    could someone help me create a source code that requires you to enter 2 numbers then gets the sum, difference, product and quotient of them after entering
  2. computer science

    hi i'm taking compsci and I need someone to give me some examples of these classes, thanks! You will have to write a class to represent one of the following items. Note that each class must a proper constructor even though the constructor …
  3. Java programming

    Write a Java program that stores Customer accounts with the attributes: (i) Name of the depositor (ii) Account number (iii) Type of account (iv) Balance amount And the methods: (i) Deposit (ii) Withdraw (iii) Display the balance You …
  4. java programming

    write a java program using arrays function for hotel bill calculation?
  5. programming

    Write a program which allows user to enter 10 student names and scores for Java programming 1 and Java programming 2. Allow user to choose which course they want to enter the record for. Use the loop to ask input from user. The program …
  6. Java Programming

    How to create a two dimensional arrays that stored the score of 3 subjects of 2 semesters, and score will added by users and program should do - Calculate the average scores of each semester - The maximum score of each semester - The …
  7. JAVA PROGRAMMING

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  8. programming

    create a program using java that calculates the current grade in a classroom. the program should ask for 5 grades as well as the total point value per grade available.
  9. java programming

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  10. java programming

    What is the name of the Java class used to create an object that reads input from the keyboard?

More Similar Questions