Advertisement
Guest User

ClockView driver

a guest
May 10th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import javax.swing.JFrame;
  2.  
  3. /**                        
  4.    This program shows a clock face.
  5. */
  6. public class ClockDriver
  7. {
  8.    private static final int FRAME_WIDTH = 300;
  9.    private static final int FRAME_HEIGHT = 350;
  10.  
  11.    public static void main(String[] args)
  12.    {
  13.  
  14.       JFrame frame = new JFrame();
  15.  
  16.       frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
  17.       frame.setTitle("Analog clock");
  18.       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  19.  
  20.       final ClockView clock = new ClockView(FRAME_WIDTH,FRAME_HEIGHT);
  21.       clock.setTime(8,20);
  22.       frame.add(clock);
  23.  
  24.       frame.setVisible(true);
  25.  
  26.    }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement