Java Tutorial

 
 
 
 
/* <applet code=\"movingBanner\" height=50 width=300> </applet> */

import java.awt.*;
import java.applet.*;

public class movingBanner extends Applet implements Runnable
{
      String msg=\" A moving Banner. \";
      char ch;
      boolean  stopFlag= true;
      Thread t= null;

      public void start(){
          t = new Thread(this);
          stopFlag=false;
          t.start();
       }

       public void run(){
             for(;;){
                 try{
                repaint();
                Thread.sleep(250);
                ch = msg.charAt(0);
                msg = msg.substring(1,msg.length());
                msg = msg + ch;
                if(stopFlag)
                     break;
                }catch(InterruptedException e) {}
            }
        }

       public void stop(){
           stopFlag=true;
           t = null;
         }

         public void paint(Graphics g){
              g.drawString(msg,60,30);
        }
}

    Related Post:
  1. Program to find a factorial of a given number

  2. Corba program to encrypt the text that you want to send on the client side. The server side decrypts it after receiving. Append server time.

  3. Word list program that reads a text file and makes an alphabetical list of all the words in that file. The list of words is output to another file

  4. Program to show the use of Nested Loops

  5. RMI program of count server and client

  6. Program to read the ballots and count the votes cast for each candidate using an array variable count

  7. Program to generate SQUARE ROOT table

  8. Program to show the use of Nested If-Else Statements

  9. Program to show an example of using a Static Nested Class outside the Top-Level Class

  10. Program to show an example of using a recursive method in a class

  11. Program to display following things on the client machine a)date and time of the server machine b)date and time of the client machine and difference

  12. Even no or Prime no?????

  13. Program to show an example of Arrays of String

  14. Program to determine the sum of the following harmonic series for a given value of n

  15. Program using session tracking capability of Servlets, which displays information of current user session by HttpServletRequest object

  16. An applet program of showing new document using showDocument(URL) method

  17. Program to show the use of some Math Methods

  18. Servlet which takes input from an HTML client page and calculates and outputs the premium amount

  19. Program to display reverse $ tree

  20. RMI servlet program to display message

 
 
Didn't find what you were looking for? Find more on An applet program to display moving banner