Morevil Chat
Previous  Parent  Next   Contents
3.1. <Applet> tag
To add the chat applet in your web page, you have to insert the following code in the HTML page:

<APPLET codebase="." archive="chat.jar" code="CHAT.class" width=85% height=80%>

<param name="server_side" value="/cgi-bin/chat.pl">

<param name="config" value="config.txt">
<param name="smiles" value="smiles.gif">
<param name="image" value="image.gif">
<param name="banner_image" value="logo.gif">

<param name="button_send" value="yes">
<param name="auto-login" value=" ">
<param name="login_first" value="no">
<param name="only_reading" value="no">
<param name="arabic" value="no">

<param name="fgColor" value="#000000">
<param name="bgColor" value="#CCCCCC">

Your browser is NOT Java enabled

</APPLET>


The required attributes are code, archive, width, and height.

The code attribute specifies the main CLASS of the chat applet.

The archive attribute specifies the archive containing classes of the chat applet

The value width and height may be either a pixel; or a percentage of the available horizontal or vertical space. Thus, the value "50%" means half of the available space.

The codebase optional attribute specifies the location of the chat applet archive (the .jar file). The given directory is relative to the directory of the HTML document that contains the reference to the applet. If this attribute is missing, the Web browser will look for the applet's file in the same directory as the HTML document.

You can provide alternate content for non-Java browsers. You do this by placing standard HTML script commands for the alternate content right before the ending tag.

The <param> tag's two parts are NAME, which specifies the parameter's name, and VALUE, which associates a value with the parameter. The parameters let you customize the chat applet.

  Description of the parameters.

server_side specifies full URL (Uniform Resource Locator) or relative path to the Perl script chat.pl.
If the path does begin with a slash (/) then it is assumed to be relative to the WebRoot directory, otherwise it is assumed to be relative to the directory where is placed the chat applet archive chat.jar.
If this parameter is omitted it is implied what chat.pl is placed in the same directory as chat.jar.

config The name of the text file that contains the configuration directives. The file must reside in the same directory as the chat applet archive chat.jar.

smiles The filename of a image with smiles. This file must be placed in the same directory as the chat applet archive chat.jar.

image The filename of a image which will be imaged at a right lower corner of the chat applet. This file must be placed in the same directory as the chat applet archive chat.jar.

banner_image The filename of a image which will be imaged at right of the banner. This file must be placed in the same directory as the chat applet archive chat.jar.

button_send Whether or not to display the button for sending the message. Values - "Yes" | "No". Default - "Yes".

auto-login Allow you to pass user name to client applet. This parameter can be generated dynamically on the server-side (Perl, PHP, ASP, JSP...) or printed inside HTML page by javascript.

login_first Whether or not to display login window after start of the chat. Values - "Yes" | "No". Default - "No".

only_reading Look and feel "only_reading". Values - "Yes" | "No". Default - "No".

arabic Look and feel "arabic"(right-to-left text). Values - "Yes" | "No". Default - "No".

fgColor Foreground color of the applet(text labels and buttons labels). Must be specified as #RRGGBB. Default #000000.

bgColor Background color of the applet. Must be specified as #RRGGBB. Default #CCCCCC.


Previous  Parent  Next   Contents