Java enabled browser shows scrolling text.



Java Scrolling Banner


The banner Java applet scrolls user-specified text strings
vertically while pausing with text centered. Scrolling contents 
can be easily customized in the html PARAM attributes
of the APPLET tag. You can specify:                           
                                                                                
  (1) up to 50 strings of displayable text                                       
  (2) rate of scrolling (in pixel step size per 50 ms time)                      
  (3) text foreground color [in decimal Red(f1), Green(f2), Blue(f3) 0-255]                  
  (4) applet background color  [Red (b1), Green(b2), Blue(b3) ]                                    
  (5) font size; the font face is fixed at TimesRoman bold                       
                                                                                

Java Scrolling Procedure


Off screen image double-buffering is used for smooth text-rendering. In the init() the applet gets parameters from the html and sets up the memory buffer. The Runnable interface is implemented and a continuous loop is started in the run() method. Each of the html-specified text-strings is consecutively sized, laterally centered in the applet panel, and scrolled vertically. This is done in the buffer image, and then rendered to the applet panel with g.drawImage(offIm,0,0,this) in the paint() method. The text scrolling position is started below the image and terminated above the image with an half second pause at center.

by M. Gallant
10/97