--------------------------------------------------------------- Text Scroller | Gregory S. Pogue Version 3.00 | pogue@inforamp.net 18/02/1996 | http://www.inforamp.net/~pogue/gregory/ --------------------------------------------------------------- Contents 1.0 - Overview 2.0 - How to set up your Web Server to use the Text Scroller 3.0 - How to embed the Text Scroller into a Web Page Appendix A - Text Scroller Parameter Listing Appendix B - The APPLET tag 1.0 - Overview The file 'TextScrollerApplet.class' is a Java(tm) applet designed to allow for the animation of text scrolling across web pages. It has been implemented with a large number of parameters to allow the web page author maximum control over the text. This applet is free for you to use and distribute as long as this readme file is attached. Please give me credit for my hard(?) work if you decide to use this applet in your own web page. Try attaching the following HTML code to the bottom of your page:
Scrolling Text Courtesy of Gregory S. Pogue, Toronto, Ontario, Canada. Copyright 1996.
If you would like to see an example of the Text Scroller in action please feel free to visit http://www.inforamp.net/~pogue/java/text-scroller-example.html. ** ADDITIONS for version 3.0 ** In version 3.0 I have added the ability to attach audio to the applet. This audio may be either played once or looped forever. See the parameter list in appendix A for a description of these parameters. Version 3.0 also allows the user to click the applet area in order to suspend/resume the animation. 2.0 - How to set up your Web Server to use the TextScroller The file 'TextScrollerApplet.class' should be stored on your web server just as an HTML document would be. Make sure that this file is treated as a binary when moving it around (ie. if you have to FTP the file from your local PC to a UNIX box somewhere, make sure you set the transfer mode to binary before you initiate the transfer). If you plan to make use of the Text Scroller from multiple HTML documents in multiple directories, you may wish to store the applet in a common directory with other applets or images (it is not necessary to place a copy of 'TextScrollerApplet.class' in every directory which contains an HTML document which makes use of it). 3.0 - How to embed the Text Scroller into a Web Page Java applets are embeded into HTML documents using the APPLET tag. For a full description of this tag see Appendix B. Here is an example of an HTML document which embeds scrolling text: Scrolling Text Example
If the 'TextScrollerApplet.class' file resides in the same directory as the HTML document, the CODEBASE tag is not required. Otherwise, the CODEBASE tag must specify the directory in which to find the .class file (using either an absolute or relative reference). Refer to Appendix A for a full listing of the parameters, their meaning, default values, and full explination. Appendix A - Text Scroller Parameter Listing Parameter Name Possible Values Default Description -------------- --------------- ------- ----------- speed 1-1000 250 a relative speed adjustment (the larger the number, the faster the text) distance 1-100 5 the number of pixels to move the text between each frame remoteText any url none a url of a file containing the text to scroll (relative or absolute) text any string some stuff the text to be scrolled (remoteText will override this, unless there is an error reading from the url) font Font name Times Roman the name of the font to use for the text size 6-100 36 the point size of the font style BOLD ITALIC PLAIN BOLD the style of the font (can be a combination) textColor name or r,g,b BLUE color of the text (can be specified as Red or 255,0,0) backgroundColor name or r,g,b WHITE color of the background (can be specified as Red or 255,0,0) alignment TOP BOTTOM CENTER CENTER alignment of the text vertically within the applet audioClip any url none a url to find an audio clip audioLoop ON OFF OFF ON if the audio clip is to loop forever Appendix B - The APPLET tag Here's the complete syntax for the APPLET tag: '<' 'APPLET' ['CODEBASE' '=' codebaseURL] 'CODE' '=' appletFile ['ALT' '=' alternateText] ['NAME' '=' appletInstanceName] 'WIDTH' '=' pixels 'HEIGHT' '=' pixels ['ALIGN' '=' alignment] ['VSPACE' '=' pixels] ['HSPACE' '=' pixels] '>' ['<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>'] ['<' 'PARAM' 'NAME' '=' appletAttribute2 'VALUE' '=' value '>'] . . . [alternateHTML] '' 'CODEBASE' '=' codebaseURL This optional attribute specifies the base URL of the applet -- the directory that contains the applet's code. If this attribute is not specified, then the document's URL is used. 'CODE' '=' appletFile This required attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute. 'ALT' '=' alternateText This optional attribute specifies any text that should be displayed if the browser understands the APPLET tag but can't run Java applets. 'NAME' '=' appletInstanceName This optional attribute specifies a name for the applet instance, which makes it possible for applets on the same page to find (and communicate with) each other. 'WIDTH' '=' pixels 'HEIGHT' '=' pixels These required attributes give the initial width and height (in pixels) of the applet display area, not counting any windows or dialogs that the applet brings up. 'ALIGN' '=' alignment This required attribute specifies the alignment of the applet. The possible values of this attribute are the same as those for the IMG tag: left, right, top, texttop, middle, absmiddle, baseline, bottom, absbottom. 'VSPACE' '=' pixels 'HSPACE' '=' pixels These option attributes specify the number of pixels above and below the applet (VSPACE) and on each side of the applet (HSPACE). They're treated the same way as the IMG tag's VSPACE and HSPACE attributes. '<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>' . . . This tag is the only way to specify an applet-specific attribute. Applets access their attributes with the getParameter() method.