Posts

To write a JAVA program to display analog clock using Applet

Image
  Program:  import java.util.*;  import java.text.*;  import java.applet.*;  import java.awt.*;  //<applet code="clockdemo" width="550" height="250"></applet  public class clockdemo extends Applet implements Runnable  {   int h=0, m=0, s=0;   String str=""; int wt, ht; Thread thr=null; boolean b;   public void init()   {   wt=getSize().width; ht=getSize().height;   }   public void start()   {   if (thr==null)   {   thr=new Thread(this);   b=false;   thr.start();   }   else   {   if(b)   {   b=false;  synchronized(this)  {   notify();   }   }   }   }   public void stop()   {   b=true;   }   public void run()   {   try  ...