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:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Java Applet | How to display a Digital Clock
- Android | How to display Analog clock and Digital clock
- Java Applet Basics
- Difference between a Java Application and a Java Applet
- Draw a Chessboard in Java Applet
- Java Applet | Digital Stopwatch
- Draw a Polygon in Java Applet
- Draw a Smiley in Java Applet
- Draw an Olympic Symbol in Java Applet
- Draw a ellipse and a rectangle in Java Applet
- Java Applet | Implementing Flood Fill algorithm
- Java Applet | Draw a line using drawLine() method
- Java Code for Moving Text | Applet | Thread
- Java Clock withZone() method in Java with Examples
- Java Clock tickMinutes() method in Java with Examples
- HijrahDate now(Clock) method in Java with Example
- How to draw a Clock using StillClock in Java
- ThaiBuddhistDate now(Clock) method in Java with Example
- Java 8 Clock fixed() method with Examples
- Clock tickSeconds() method in Java 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.