import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Clock extends JPanel implements ActionListener{
JFrame frame;
int center_X,center_Y;
int r,start_X,start_Y;
public Clock()
{
frame = new JFrame("hellboy clock");
//this.setSize(300,300);
this.setBackground(Color.black);
frame.setBounds(200,200,300,300);
this.init();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(this,"Center");
frame.setVisible(true);
}
public void init()
{
center_X=(int)(frame.getSize().width/2);
center_Y=(int)(frame.getSize().height/2);
System.out.println(center_X+" "+center_Y);
r = (int)(center_X*0.8);
start_X=center_X-r;
start_Y=center_Y-r;
System.out.println(start_X+""+start_Y);
}
public void paint(Graphics g)
{
super.paintComponent(g);
g.drawOval(start_X,start_Y,2*r,2*r);
g.drawRect(start_X,start_Y,2*r,2*r);
g.fillOval(center_X,center_Y,5,5);
}
public void actionPerformed(ActionEvent e)
{
}
public static void main(String[] arg){
new Clock();
}
}