Morevil
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" width=750 height=450>

<param name="config" value="config.txt">
<param name="smiles" value="on">
<param name="multi-rooms" value="on">

<param name="auto-login" value=" ">
<param name="profile" value="http://www.your_site.com/profile.php?user=">

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

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.

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 Whether or not to display smiles. Values - "On" | "Off". Default - "On".
The file smiles.gif with smiles must be placed in the same directory as the chat applet archive chat.jar.

multi-rooms If "On" the chat run in multi-rooms mode. Values - "On" | "Off". Default - "On". The file rooms.txt with names of the rooms must be placed in the same directory as the chat applet archive chat.jar.

auto-login If you use DB authentication on your site you can pass user name to the chat applet. This parameter can be generated dynamically on the server-side (Perl, PHP, ASP, JSP...) or printed inside HTML page by javascript.

profile If this parameter is present button "profile" appears at top of the userlist.
e.g. if value of this parameter set as http://www.your_site.com/profile.php?user=
at press the button "profile" in a new browser window the page http://www.your_site.com/profile.php?user=some_user will be opened.
You can develop the script profile.php to extract users profile from your database.

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 #DDDDDD.


Previous  Parent  Next   Contents