Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myjavaprograms;
- import java.awt.*;
- import javax.swing.JFrame;
- public class ClockFace extends Canvas
- {
- public void paint( Graphics g )
- {
- g.setColor(Color.white);
- g.fillOval(___,150,300,300);
- g.setColor(Color.black);
- g.drawOval(250,150,300,300);
- g.setColor(Color.gray);
- g.fillOval(385, 285, 30, 30);
- g.drawString("12", ____, 165);
- g.drawString("6", 395, 445);
- g.drawString("__", ____, ____);
- g.drawString("__", 260, ____);
- g.setColor(Color.black);
- g.drawLine(400, 165, 400, 300);
- g.drawLine(___, 300, ____, 300);
- }
- public static void main( String[] args )
- {
- JFrame win = new JFrame("Clock Face");
- win.setSize(800,600);
- win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- ClockFace canvas = new ClockFace();
- win.add( canvas );
- win.setVisible(true);
- }
- }
Add Comment
Please, Sign In to add comment