import java.awt.Graphics;
 import java.awt.*;
 import java.util.*;
 import javax.swing.*;
 import java.text.*;
import java.awt.event.*;



public class clockP extends JPanel implements Runnable 
{
JTextArea jb;
JPanel inputpanel;
 int second;
 int minute;
 long counter;

Thread runner;
public clockP()
{   inputpanel=new JPanel();
    counter=0;
    second=0;
    minute=0;
	String s=" minute = "+minute+" second = "+second;
	jb=new JTextArea(s);
	jb.setFont(new Font("Serif",Font.ITALIC,24));
	Color c=this.getBackground();
	jb.setBackground(c);
    inputpanel.add(jb);
    add(inputpanel);
    runner=new Thread(this);
    runner.start();
}   
     public void run()
     {
        while(true)
        {
	 try
	 {
	 second=(int)counter%60;
	 minute=(int)counter/60;
	 Thread.sleep(1000);
	 counter++;
     } catch(InterruptedException ex) {System.out.println("error...");}

	    String s=" minute = "+minute+" second = "+second;
	    jb.setText(s);
        repaint();
        }
    }
}
