Anton
Leach
|
Telephone: 0966 439 709, Web: www.antonleach.com, Email: anton@antonleach.com. |
This is a client-server style scrolling text Java Applet. The messages are fetched from a file on your web server, with each one as a clickable 'hot' link. After all the messages have been shown, the applet contacts your server and reads the message file again. (So you could combine it with a CGI on your server to make a news service.)
The text can scroll left to right, or bottom to top, and you can also frame the text within a background image to produce some of the effects shown below. Also, the text can be set to pause when it reaches the left or the middle, so people can have chance to read it!
There are many parameters you can tune, but all have defaults, so yo can ignore any which you don't need to change.
| <applet code="sText2.class"
width="200" height="60"> </applet> |
|
| <applet code="sText2.class"
width="150" height="60"> <PARAM NAME="scroll" VALUE="up"> <PARAM NAME="background" VALUE="000000"> <PARAM NAME="foreground" VALUE="FFFFFF"> <PARAM NAME="fontHAlign" VALUE="center"> <PARAM NAME="pause" VALUE="20"> </applet> |
|
| <applet code="sText2.class"
width="150" height="124"> <PARAM NAME="scroll" VALUE="up"> <PARAM NAME="image" VALUE="batmoon.gif"> <PARAM NAME="fontSize" VALUE="12"> <PARAM NAME="foreground" VALUE="FFFFFF"> <PARAM NAME="fontHAlign" VALUE="center"> <PARAM NAME="textX" VALUE="10"> <PARAM NAME="textY" VALUE="40"> <PARAM NAME="textWidth" VALUE="120"> <PARAM NAME="textHeight" VALUE="70"> <PARAM NAME="pause" VALUE="20"> <PARAM NAME="wait" VALUE="2000"> <PARAM NAME="messageFile" VALUE="ticker2.txt"> <PARAM NAME="defaultMessage" VALUE="Bats"> </applet> |
|
| <applet code="sText2.class"
width="150" height="124"> <PARAM NAME="image" VALUE="office.gif"> <PARAM NAME="textX" VALUE="16"> <PARAM NAME="textY" VALUE="14"> <PARAM NAME="textWidth" VALUE="127"> <PARAM NAME="textHeight" VALUE="50"> </applet> |
You are welcome to use this Applet on your own web site or Intranet, entirely at your own risk, no warranties implied etc. You can download a self extracting PC file. If you do use it, please send me an email, and if you want to give me a credit and link back to my web site http://www.antonleach.com, that would be much appreciated.
Please note: I retain copyright and intellectual property rights. You are not allowed to re-distribute this or charge for it in any way.
The previous version of this applet is still available. It is 7k in size as opposed to the 10k of this one, but it lacks many of the features and is harder to configure.
Have fun!
Anton Leach June 1998
OK, pay attention....
You only have to change the parameters you don't like. Ignore the rest.
| PARAM | Description | Values | Default |
|---|---|---|---|
| foreground | Colour of the text | RGB like "FF0065" | Black "000000" |
| background | Background colour | RGB Colour | White "FFFFFF" |
| highlite | Text colour when mouse is in applet area | RGB Colour | Red "FF0000" |
| refresh | How many times to show each message before checking the server for new ones | Number of cycles | 20 |
| pause | How many milliseconds between drawing each frame - more scrolls the text slower | Number of milliseconds | 6 |
| wait | How long to pause the message to give time to read it | Number of milliseconds | 800 |
| scroll | Move left to right or top to bottom | Up | Left | Left |
| targetFrame | Frame or new window to open when a message is clicked on | Frame name, or "_self" to open in current window | "new_window" |
| fontName | Standard Java text font | Helvetica | Times | Courier | Dialog | Dialoginput | ZapfDingbats. Plus you can add '-bold', '-italic', '-bolditalic' to the font name | Helvetica |
| fontSize | Size | Number | 12 |
| fontHAlign | Horizontal alignment | left | center | right | left |
| fontVAlign | Vertical alignment | top | middle | bottom | middle |
| fontLeading | Leading | Number | 14 |
| image | URL of a GIF image to use as the background. If you use an image, the background colour is ignored. | URL | none |
| messageFile | URL of a file containing the messages | URL | ticker.txt, in the same folder as the applet HTML |
| defaultMessage | Text to display while connecting to the server for new messages | Text | "Connecting to server..." |
| defaultURL | URL to link to if the default message is clicked | URL | 'NOLINK' | NOLINK |
| textX | x co-ordinate of the text display area | Number of pixels | zero |
| textY | y co-ordinate of text area | Number of Pixels | zero |
| textWidth | width of text area | Number of Pixels | width of applet |
| textHeight | height of text area | Number of Pixels | height of applet |
The message file is an ASCII file like this:
# Message file for sText
2.0
#
# Each message starts with a URL, or the word NOLINK
# Everything following is the message associated with that URL,
until
# a blank line, which termiates the message
http://www.antonleach.com/sText2/linkpage.htm
A simple message
http://www.antonleach.com/sText2/linkpage.htm
One which spans
two lines
NOLINK
This one is not clickable
mailto:anton@antonleach.com
This is an email link
The main problem which you might have is with the Java secutity, which will only allow you to use a message file which is on the same server as the applet .class file. There is no way round this - they have to be on the same server.
If there are any other questions, please mail me at anton@antonleach.com