You can pause/resume the applet by clicking on it.
30 May 1997
HollywoodText is a JavaTM text display applet that simulates the look of those computer terminal displays that exist only in the movies. But now you can have one on your homepage.
This applet has been tested on Windows 95, with Explorer 3.02, Navigator 3.01, HotJava 1.0 and appletviewers from JDK's 1.02 and 1.1. It was compiled using MS Visual J++ 1.1.
The applet does call Thread.suspend, which generates a warning in Navigator's Java console, although this can be safely ignored. Fastest download and performance is with Explorer, using a CAB file. HotJava also downloads quickly with a JAR file, although most surfers are not using HotJava, so a JAR is not provided with the distribution.
Unpack the zip with a zip utility that supports long file names. When you upload it to your web directory, use an FTP program (or other suitable tool) that also supports case-sensitive, long filenames. These are general words of wisdom that apply to all Java applets.
HollywoodText consists of a single class file, HollywoodText.class. For the demo, a background image, demo.gif is provided, as well as a sample text script, demo.txt. An Explorer-compatible CAB file, HollywoodText.cab is also provided which can be uploaded to your web directory for the benefit of visitors running Explorer (use the CABBASE parameter, see sample HTML below.)
The applet permits customizing its appearance with a variety of parameters. Don't worry, you do not have to use all of them, but it is nice to have them there if you need them.
Writing a script for the applet involves little more then typing each line of text that you want displayed with a text editor (such as Windows Notepad) and saving the file. You should upload your script into the same directory as your applet class file.
There are four "tags" that can be used to provide a little control over your text display.
<NEWLINE> - causes the applet to display a blank line (skip a line.)
<NEWPAGE> - causes the applet to display on a fresh "page", clearing old text, although this is also handled automatically. Use <NEWPAGE> to force it if desired.
<PAUSE ###> - causes the applet to pause display for a specified number of milliseconds. For example, <PAUSE 1000> will result in a 1 second delay. A value of 0 will suspend the applet, but clicking on it will restart it.
<MORE> - will display "More..." and suspend the applet, click to restart. This will also be handled automatically, but you can force display of "More..." with this tag.
Sample Script - Here's the script used in the demo:
HollywoodText Demo ------------------ This applet displays text the way Hollywood movie computers do. <NEWLINE> <PAUSE 1000> When you see "More..." click on the applet to continue. That's all... it's trivial, but a fun applet for a personal web page :-) <NEWLINE> <PAUSE 1000> Click on the applet to run it again.
Note that the code does not automatically wrap long lines. Compose your script so that it takes the width of your text display into consideration.
Here is the applet code used to place the HollywoodText applet on this page.
<applet code="HollywoodText.class" width=304 HEIGHT=204> <param name=cabbase value=HollywoodText.cab> <param name=bgcolor value=#000000> <param name=fgcolor value=#00FF00> <param name=sound value=blip.au> <param name=cpause value=25> <param name=lpause value=250> <param name=spause value=500> <param name=loop value=0> <param name=script value=demo.txt> <param name=lspace value=15> <param name=fontsize value=12> <param name=cursor value=3> <param name=indent value=2> <param name=initx value=20> <param name=inity value=20> <param name=bgimage value=demo.gif> <param name=maxy value=160> Sorry... You are not Java capable. </applet>
You do not have to implement all of these parameters. Only a few are actually required. The first parameter, CABBASE is for MS Internet Explorer browsers and is really not a specific parameter of this applet. It tells Explorer to download a compressed version of the applet, resulting in improved performance.
The line "Sorry... You are not Java capable" is only displayed if a non-Java browser hits the page. At least one version of Navigator Gold's HTML editor flags this as an HTML error, even though it is not. You can safely ignore this warning if you receive it.
The following table describes the formal parameters of the applet:
| Name | Type | Description | Default Value |
| HEIGHT | int | The height of the applet panel in pixels, this is really not a parameter but rather an attribute of the applet tag. You should set the applet height to the vertical size of your background image (if you use one.) Required. | None |
| WIDTH | int | The width of the applet panel in pixels. Like HEIGHT, it also is an attribute of the applet tag, and should be set to the horizontal size of your background image, if you use one. Required. | None |
| BGCOLOR | String | The color of the simulated screen background of the applet. Even if you provide an image (such as in the demo) the actual portion of the image where text is displayed should be an opaque color (in the demo, it is black.) If you do not use an image, this color will be used to paint the applet panel. Colors are entered as hexadecimal RGB triplets, such as #FFFFFF or FFFFFF for white. | Black (000000) |
| FGCOLOR | String | The color used to paint the text, entered as a hexadecimal RGB triplet, such as #000000 or 000000 for black. | Green (00FF00) |
| SOUND | String | The name of an audio file (.au format) that will be played as each character is displayed. This should be a short clip, no longer then the delay setting for character pauses (by default 25 milliseconds.) The name specified should be relative to the applet's codebase. The easiest way to ensure this is to simply place your sound clip in the same directory as the applet class file, and then just provide the filename for this parameter. | None |
| CPAUSE | int | The pause interval over which the text display engine will sleep in between each character that is displayed, in milliseconds. | 25 ms |
| LPAUSE | int | The pause interval over which the text display engine will sleep in between each line of text that is displayed, in milliseconds. | 250 ms |
| SPAUSE | int | The pause interval over which the text display engine will sleep in between each loop of full execution (if enabled, see LOOP parameter below) in milliseconds. | 500 ms |
| LOOP | int | A non-zero value causes the text display to loop continuously, subject to whatever pause value is set for SPAUSE. | 1 |
| SCRIPT | String | The name of the script file containing the text to be displayed, relative to the codebase of the applet. The easiest thing to do is to place your script in the same directory as your applet class, and just use its name. Required | None |
| LSPACE | int | The dimension used to space lines of text. It should generally be about 25% larger then the font size. | 15 |
| FONTSIZE | int | The font size, in pixels, used to display text. | 12 |
| CURSOR | int | The width, in pixels, of the simulated cursor. | 3 |
| INDENT | int | The indentation, in pixels, for each line of text. This will be relative to the INITX parameter (see below.) For example, if you use an INITX value of 5, and an INDENT value of 5, text lines will start 10 pixels left of the applets left edge. | 15 |
| INITX | int | The x-origin of your virtual terminal area, in pixels, measured from the left edge of the applet. | 0 |
| INITY | int | The y-origin of your virtual terminal area, in pixels, measured downward from the top edge of the applet. | 0 |
| BGIMAGE | String | The optional background image. If none is provided, the applet panel will paint itself the BGCOLOR value.The image file should be relative to the applet's codebase.The easiest way to ensure this is to simply place your image in the same directory as the applet class file, and then just provide the filename for this parameter. Both GIF's and JPG's are supported. | None. |
| MAXY | int | The lowest point for text display, in pixels, measured downward from the top edge of the applet. If no MAXY value is provided, the applet will display text to the bottom edge of the applet panel. | None |