Home Help and FAQs Submit Java Link To Us Contact Us Home

Audio Effects
Banner Utilities
Browser Utilities
Color Picker
Cursor Effects
Email Forms
Fun and Games
Horizontal Rules
Image Effects
Popup Windows
Site Search
Status Bar
Text Effects
Ticker Tapes
Web Search
Website Tools
JavaFile Articles


Typing Text Effect

This applet will display text as if it were being typed on a typewriter.

How to use the applet Tags:

The applet tag identifies the location, class file name, and size of a Java applet. Below is a small sample applet tag (or view the source for this document to see the applet tag for the above implementation of the applet). The first part of the tag code="TypeText.class" identifies the name of the Java program. The second part codebase="java/" identifies the relative location of the file (leave codebase blank if the class file is located in the same directory as the HTML document).

<applet code="TypeText.class" codebase="java/" width="500" height="100">
<param name="desc0"value="my first message">
<param name="desc1"value="my second message">
<param name="desc2"value="my third message">

The third and fourth part of the applet tag identifies the width and height of the applet (usually measured in screen pixels).

The parameters are defined below the applet start tag with the parameter name first, followed by the value of the parameter. (see below for the complete parameter list for this applet). You may add as many parameters as the applet allows for. (If a parameter is not working, first double check that its spelling and case are typed correctly.)

The last part works like all other HTML tags and defines the end of the applet tag </applet>.

Information about the applet and its parameters

Required Parameters

Parameter 1 (the "notice" tag) must be included in the applet tag in order for the applet to work. Most of the parameters will default if you fail to define them, at a minimum you must include the notice tag and description parameters for you messages. Usually the easiest way to customize the applet is cut and paste the applet tag information used in the sample and modify it to fit your web page.

Defining Colors

To define a color in one of the color parameters using RGB choose a value between 0 - 255 for the red, green, and blue components separated by commas and typed out in the correct r,g,b order. Below is a sample of how a color parameter using RGB should look, the example specifies several different sample colors for the "bgcolor" parameter.

WHITE: <param name="bgcolor" value="255,255,255">
GREEN: <param name="bgcolor" value="0,255,0">
BLACK: <param name="bgcolor" value="0,0,0">
YELLOW: <param name="bgcolor" value="255,255,0">
OFF WHITE: <param name="bgcolor" value="240,239,234">

The best way to choose the exact color you are looking for without having to guess the numbers is to access your systems Color Picker. Color Pickers usually allow you to drag the mouse over a rainbow type color grid to select a color, and show you the appropriate RGB values. In windows the Color Picker is accessible through MS Paint as well as a majority of the popular Imaging and HTML Authoring Software.

The Applet Parameters

The Applet

Parameter 1
Attribute: Copyright notice.
param name="Notice"
value="Typewriter Text Effect, Copyright (c) 1997, OpenCube Technologies, FreeWare"
Note: This must be included for the applet to work.

Parameter 2
Attribute: Background Color
param name="bgcolor"
Value=r,g,b, Where r,g,b is the color to use for the background, see above for information on defining colors.
DEFAULT: white

The Typewriter Messages

Parameter 3
Attribute: Message
param name="desc0" - "descN"
value=X, where X is the message to be typed onto the screen. Use desc0 to define your first message, desc1 to define your second, etc., etc.

Parameter 4
Attribute: Text Color
param name="textcolor"
Value=r,g,b, Where r,g,b is the color to use for all messages, see above for information on defining colors.
DEFAULT: black

Parameter 5
Attribute: Message Font Size
param name="size"
value="X", Where X is the specific size for all messages.

Parameter 6
Attribute: Message Font Name
param name="fontface"
value="X", Where X is the name of a standard Java Font (Dialog, Helvetica, TimesRoman, Courier, Symbol)
DEFAULT: "Helvetical"

Parameter 7
Attribute: Font Style
param name="style"
value= bold, italic, bolditalic, plain
DEFAULT: plain

Parameter 8
Attribute: Center Text
param name="centertext"
Value= true or false, true = yes, center all messages. False = no, left justify all messages to the margin defined with the "xoffset" parameter
DEFAULT: false

Parameter 9
Attribute: Left Margin Width
param name="xoffset"
Value=X, Where X is the horizontal distance from the left side of the applet to start the message, This parameter is valid only if centering is turned off.

Parameter 10
Attribute: Bottom Margin
param name="yoffset"
Value=X, Where X is the distance from the bottom of the applet to draw the typewriter effect.

Animation Timing

Parameter 11
Attribute: Typewriter Delay
param name="typedelay"
Value=X, Where X is the length of time in milliseconds until the next letter to appears during the typewriter animation. Usually 25 - 500 works well.
DEFAULT: 100 (1/10th second)

Parameter 12
Attribute: Message Delay
param name="delay"
Value=X, Where X is the length of time in milliseconds for the message to pause once completely typed onto the screen.
DEFAULT: 2000 (2 seconds)

Parameter 13
Attribute: Scroll Delay
param name="scrolldelay"
Value=X, Where X is the length of time in milliseconds between each scroll frame when the text is scrolling out of view

The Scrolling Message

Parameter 14
Attribute: Use Scrolling
param name="scrollit"
Value= true or false, True = yes, scroll message out of view, false = no, erase messages with no transition effect

Parameter 15
Attribute: Scroll Jump Size
param name="scrolljump"
Value= X, Where X is the distance to jump for each scroll frame. Use this parameter in conjunction with the scrolldelay parameter to precicly time the scroll.

Author: OpenCube Technologies

Download the Script

Share |


Copyright 1998-2012, Net3Media.com    Ad Info: Click Here    Privacy Policy