codebase
specification.
Specification of Applet Parameters
The other items in the above applet tag are specifications of parameters
that allow the user to customize the behavior of the
applet (these are the lines beginning with "param").
The meanings of the parameters for the TickerTape applet are:
- count -- total number of messages (3 in the above example)
- msg0, msg1, ... -- individual messages; note that the count starts with
0, not 1; each consists of the message text, followed by two backslashes,
followed by a URL (linking the message to the URL)
- txtco -- color of message text, coded as a (Red, Green, Blue)
RGB triplet with the
components
separated by commas, and each component a number in the range 0-255 indicating
the amount of red, green, and blue, respectively (for example, the triple
255, 255, 255 is white, 0, 0, 0 is black, and 0, 255, 0 is pure green).
- bgco -- background color (denoted in the same format
as txtco)
- linkco -- active link color (same format as txtco)
- speed -- specifies the scrolling speed
Note that each displayed message can contain a hypertext
link. The URL for the link is
displayed at the bottom of the browser window when the cursor is placed over
that scrolling message.
You can activate a link by clicking on it as it scrolls by. If a message does
not contain a link you should still include two backslashes after the message
text (followed by optional
text that will be displayed at the bottom of the browser window when the cursor
is placed over that message).
Add the TickerTape Applet to Your Page
You can add this ticker tape banner to your pages and have it display whatever
message(s) you desire. You only need to get the file
NavigatorTicker11.class,
add the above section of HTML code to the desired
spot on your page, and modify the parameters to show the messages you want in
the colors and speed you like (remember to place the Java class file
in the same directory as your homepage file unless you add a
codebase
specification
to indicate which directory it is in).
The applet is free for you to use. The author only asks that you give credit
to its developer (see information at the site where you obtain the class file).
Customizing the Applet
Experiment with modifying the example:
- Change Fred's name to your own, to make the banner a greeting to
your homepage.
- Add a fourth message. (Don't forget to update the value of the count
parameter!)
- Change the background color to bright red (255,0,0).
- Change the text color to cyan (0,255,255).
- Experiment with changing the scrolling speed. What happens if you use
values of the speed parameter greater than 8? Less than 8?
- Now customize the banner to display the messages that you would like for
it to display and add it to your
homepage.
Note:
In some cases
the applet may not be reloaded with the new parameters in effect if you
simply reload the Web page. You may have to exit your browser and restart it
in order to see the changes. Java is a rather new language on the Web
and there still are some bugs in its implementation for many browsers.
Java Example: Adding Bar Graphs to a Page
Here is an example, with rather complete documentation, of using Java to add
bar graphs to a Web page. For example, you could use this Java applet to
display a bar graph updated daily on your Web page of how many file accesses
there have been to your site each day for the last 30 days, or of what the high
temperature has been at your school each day for the last month.
Some More Java Examples
If you would like to add more applets to your Web pages, check out
some additional examples at
Be sure to download the class file (or files) and a sample applet tag showing
what parameters can be set for any applets that you want to add to your pages.
In all cases, give credit where credit is due if you are using someone else's
applet.