Skip to content

Clock

Use a Timer to draw the hands of an analog clock on a JPanel.

Section titled “Use a Timer to draw the hands of an analog clock on a JPanel.”
Use a Timer to draw the hands of an analog clock on a JPanel.

AnalogClock

We use javax.swing.Timer to get the current time and draw the hands of an analog clock on a JPanel.

Use AffineTransform to place numbers on an analog clock face.

Section titled “Use AffineTransform to place numbers on an analog clock face.”
Use AffineTransform to place numbers on an analog clock face.

ClockWithArabicOrRomanNumerals

Use AffineTransform to place Arabic and Roman numerals on an analog clock face.

Use AffineTransform to rotate Arabic numerals and place them on the clock face.

Section titled “Use AffineTransform to rotate Arabic numerals and place them on the clock face.”
Use AffineTransform to rotate Arabic numerals and place them on the clock face.

ArabicClockFace

Use AffineTransform to position Arabic numerals with different rotations in the upper and lower halves of the clock face.

JFrame transparency and redrawing

TranslucentFrameRepaint

We will place a semi-transparent digital clock in a transparent JFrame and test the redrawing of the background color when the text is updated.

Use AffineTransform to transform Path2D and create numbers for a 7-segment digital clock.

Section titled “Use AffineTransform to transform Path2D and create numbers for a 7-segment digital clock.”
Use AffineTransform to transform Path2D and create numbers for a 7-segment digital clock.

SevenSegmentDigitalClock

Use AffineTransform to transform and combine Path2Ds to create numbers for a 7-segment digital clock.

Creating a dot matrix LED digital clock with JList

Section titled “Creating a dot matrix LED digital clock with JList”
Creating a dot matrix LED digital clock with JList

DotMatrixLedDigitalClock

Set the JList to a vertical newspaper-style layout and place an LED-like icon in each cell to create a dot matrix LED digital clock.