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 change characters in a StringBuffer objects and to reverse its contents

  2. Encrypt the text that you want to send on the client side. The server side decrypts it after receiving. Append server time after each word in the sent

  3. An applet program to draw Polygon Graph with given data

  4. Program to show the use of Labeled Continue Statement

  5. Program to print triangle of numbers

  6. Program to show an example of searching Strings for characters

  7. Program to show the use of Logical AND Operator (&) in If Statements

  8. Develop a game application in CORBA for which the player will guess a number between 1 to 100, which will be compared to the random number generated b

  9. Application which takes your marks of six subjects from the client side and displays the percentage that you have obtained

  10. RMI program of count server and client

  11. Program to show the use of operator (&gt;&gt;) Shift Right, propagating the sign bit from the left

  12. Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object

  13. Develop a CORBA application that takes a string from client and returns whether it is palindrome

  14. Program to show an example of Overriding a Base Class Method

  15. Program to Display Output in triangular shape

  16. Corba program to develop a simple calculator with addition, subtraction, multiplication and division capabilities, data collection from client side

  17. Develop a CORBA based application for addition of two complex numbers and displaying the result on client side

  18. Program to find a factorial of a given number

  19. Program to show the use of Increment and Decrement Operators

  20. Corba program of reverse string

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