In this article, we shall be animating the applet window to show an Analog Clock with a 1-second delay. The idea is to display the system time of every instance.
Each hand of the clock will be animating with 1-second delay keeping one end at the centre. The position of the other end can be derived by the system time. The angle formed by a hand of the clock in every second will be different throughout its journey. This is why various instances make a different angle to the horizontal line.
How to run:
1. Save the file as analogClock.java and run the following commands. 2. javac analogClock.java 3. appletviewer analogClock.java
Below is the implementation of the above approach:
- Java Applet | How to display a Digital Clock
- Android | How to display Analog clock and Digital clock
- Java Applet Basics
- Draw a Chessboard in Java Applet
- Draw a Smiley in Java Applet
- Draw a Polygon in Java Applet
- Java Applet | Digital Stopwatch
- Draw an Olympic Symbol in Java Applet
- Draw a ellipse and a rectangle in Java Applet
- Java Code for Moving Text | Applet | Thread
- Java Applet | Draw a line using drawLine() method
- Java Applet | Implementing Flood Fill algorithm
- Java Clock tickMinutes() method in Java with Examples
- Java Clock withZone() method in Java with Examples
- Java 8 Clock equals() Method with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.