"Quote" Documentation |
I got the idea for this applet from Ken Arnold's "fortune", a program I have under Linux. Some of the quotes in my file EnQuotes.txt come from there too...
Your HTML document should include something like this:
<APPLET CODEBASE="Java/Quote" CODE="Quote.class" WIDTH=400 HEIGHT=100> <PARAM NAME=dataFile VALUE="EnQuotes.txt"> </APPLET>CODEBASE is only necessary if the HTML file and the file Quote.class are in different folders. CODEBASE represents the path between the HTML file and the file Quote.class. Thus in the above example, the folder containing the HTML file has a sub-directory named Java. This one contains a sub-directory named Quote. This one contains the files Quote.class and EnQuotes.txt.
<APPLET CODE="Quote.class" WIDTH=400 HEIGHT=100> <PARAM NAME=dataFile VALUE="EnQuotes.txt"> <PARAM NAME=typingDelay VALUE="200"> <PARAM NAME=crDelay VALUE="2000"> <PARAM NAME=keySound VALUE="audio/button_2.au"> <PARAM NAME=spaceSound VALUE="audio/button_1.au"> <PARAM NAME=returnSound VALUE="audio/return.au"> <PARAM NAME=fontName VALUE="Helvetica"> <PARAM NAME=fontStyle VALUE="2"> <PARAM NAME=fontSize VALUE="24"> <PARAM NAME=textColor VALUE="FFFFFF"> <PARAM NAME=bgColor VALUE="0000FF"> </APPLET>If your browser is compatible with Java, JavaScript and Frames, you can easily test the parameters.
<PARAM NAME=dataFile VALUE="Java/Quote/EnQuotes.txt">VALUE is the relative path from Quote.class to the text file containing the quotes.
The format of this file is very simple:
This parameter is the only one that is required.
<PARAM NAME=typingDelay VALUE="200">VALUE is the delay in milliseconds between each character.
Defaults to 100.
<PARAM NAME=crDelay VALUE="2000">VALUE is the delay in milliseconds used for the carriage return. Especially useful if you're going to use the returnSound parameter. This delay will then have to be set according to the length of the sound used.
Defaults to 1000.
<PARAM NAME=keySound VALUE="Java/Quote/audio/button_2.au">VALUE is the relative path from Quote.class to the sound you want to use for ordinary keys.
Defaults to no sound.
<PARAM NAME=spaceSound VALUE="Java/Quote/audio/button_1.au">VALUE is the relative path from Quote.class to the sound you want to use for the space bar.
Defaults to no sound.
<PARAM NAME=returnSound VALUE="Java/Quote/audio/return.au">VALUE is the relative path from Quote.class to the sound you want to use for the carriage return. You'll probably want to set the crDelay parameter so that this sound has time to finish playing before the applet starts typing the next line.
Defaults to no sound.
<PARAM NAME=fontName VALUE="Helvetica">Defaults to TimesRoman.
<PARAM NAME=fontStyle VALUE="2">VALUE is an integer in the range [0..3] with the following correspondence:
VALUE | Style |
---|---|
0 | PLAIN |
1 | BOLD |
2 | ITALIC |
3 | BOLD + ITALIC |
Defaults to 0.
<PARAM NAME=fontSize VALUE="24">Defaults to 12.
<PARAM NAME=textColor VALUE="FFFFFF">VALUE is an int in hexadecimal (base 16).
Defaults to 000000 (black).
<PARAM NAME=bgColor VALUE="0000FF">VALUE is an int in hexadecimal (base 16).
Defaults to FFFFFF (white).