• public class ClockView
    extends javax.swing.JPanel
    • Constructor Detail

      • ClockView

        public ClockView(int width,
                 int height)
        Construct a clock with the current time.
        Parameters:
        width - desired width of the clock (pixels)
        height - desired height of the clock (pixels)
    • Method Detail

      • setTime

        public void setTime(int hour,
                   int minute)
        Set the time to be displayed on the clock.
        Parameters:
        hour - desired hour (0-11)
        minute - desired minute( 0 - 59)
      • paintComponent

        public void paintComponent(java.awt.Graphics g)
        Overrides:
        paintComponent in class javax.swing.JComponent