JavaZOOM Web Site jChatBox homepage
  Software
  
Installation
  
Configuration
  
Administration
  
User guide
  
API & Extension
  
License

<< back

- Applet Client -

• How does it work ?
Applet client communicates to jChatBox XMLConnector service (server-side) through HTTP. Applet sends HTTP GET requests to get chatroom information, to login/logout and to chat. XMLConnector returns standard XML formated responses that will be processed by the Applet client. Applet client needs NanoXML (XML parser) to process responses.


APPLET chat client with jChatBox XML Connector Service

Applet configuration parameters :
Before running jChatbox client applet you could configure a few parameters (default ones should be ok). To do so you have to edit APPLET tag from your HTML file (some are available into applet/ folder) and modify bold parameters as shown below :

<html>
...
<applet codebase="." archive="jchatboxclientapplet.jar,nanoxml.jar" code="jchatbox.client.jcbApplet" width="512" height="410">
   <param name="serverurl" value="http://chat.com/xml_connector/processor.jsp">   
   <param name="skin" value="skin_comics">
   <param name="refresh" value="3">
   <param name="loglevel" value="1">
   <param name="timeout" value="10">
</applet>
...
</html>

width and height : Dimensions of the applet. Note that dimensions of background images should be identicals.
serverurl
: This parameter is the URL to processor.jsp from jChatBox server.
skin : This parameter is the web path to the current skin.
refresh : This parameter sets the refresh rate, in seconds, with the server. -1 means that refresh rate is controlled bt the server.
loglevel : This parameter sets the level of debug traces (advanced users only).
timeout : This parameter sets the time out, in seconds, for socket connections with the server
(advanced users only). -1 means no timeout.

Applet skins customization :
jChatBox client applet provides four skins : Multilanguage, eXtremeSUN, Manga and Comics
(see below). Each skin is customizable through the jcbskin.xml file under the skin_custom/ folder. You can modify background color or image, font size, font color, features location, size and labels... for both LoginPanel and ChatPanel.
You can also create a new skin from scratch. For instance, if you want to create a Cartoon skin then you have to create a skin_cartoon/ folder and copy all your skin stuff (background images and jcbskin.xml) under it.

Here is a sample for jcbskin.xml for Comics skin :

<JCBSKIN NAME="Comics">
<LOGINPANEL FONTNAME="Helvetica" FONTSIZE="12" FONTSTYLE="bold" BGCOLOR="000000" BGIMAGE="comics.jpg">
<LABEL ID="USERNAME" X="26" Y="200" WIDTH="70" HEIGHT="23" COLOR="FF8855">Username :</LABEL>
<LABEL ID="CHATROOMS" X="5" Y="230" WIDTH="90" HEIGHT="22" COLOR="FF8855">Comics rooms :</LABEL>
<LABEL ID="NAME" X="280" Y="15" WIDTH="210" HEIGHT="22" COLOR="FFFFFF">Room : </LABEL>
<LABEL ID="DATE" X="280" Y="50" WIDTH="210" HEIGHT="22" COLOR="DDDDDD">Opened since : </LABEL>
<LABEL ID="SUBJECT" X="280" Y="32" WIDTH="210" HEIGHT="22" COLOR="EEEEEE">Topic : </LABEL>
<LABEL ID="ERROR" X="100" Y="289" WIDTH="267" HEIGHT="22" COLOR="FF0000"></LABEL>
<LABEL ID="WELCOME" X="55" Y="352" WIDTH="228" HEIGHT="51" COLOR="FFFFFF">- Welcome to jChatBox client Applet -|Homepage : http://www.javazoom.net</LABEL>
<BUTTON ID="LOGIN" X="100" Y="266" WIDTH="68" HEIGHT="20" COLOR="FF8855" BGCOLOR="551111">Join</BUTTON>
<TEXTFIELD ID="USERNAME" X="101" Y="200" WIDTH="120" HEIGHT="21" COLOR="CCDDFF" BGCOLOR="222222"/>
<CHOICE ID="ROOMS" X="100" Y="230" WIDTH="130" HEIGHT="18" COLOR="DDEEFF" BGCOLOR="222222" FIRSTITEM="Select one ..."/>
</LOGINPANEL>

<CHATPANEL FONTNAME="Helvetica" FONTSIZE="12" FONTSTYLE="bold" BGCOLOR="CCDDFF" BGIMAGE="comics.jpg">
<LABEL ID="MESSAGE" X="4" Y="370" WIDTH="70" HEIGHT="22" COLOR="DDEEFF">Message :</LABEL>
<LABEL ID="NAME" X="4" Y="392" WIDTH="190" HEIGHT="22" COLOR="DDEEFF">Chatroom : </LABEL>
<BUTTON ID="SEND" X="415" Y="370" WIDTH="70" HEIGHT="21" COLOR="FF8855" BGCOLOR="551111">Post</BUTTON>
<BUTTON ID="REFRESH" X="415" Y="346" WIDTH="70" HEIGHT="21" COLOR="222222" BGCOLOR="CCCCCC">Refresh</BUTTON>
<BUTTON ID="LOGOUT" X="415" Y="12" WIDTH="70" HEIGHT="25" COLOR="220000" BGCOLOR="CCBB55">Logout</BUTTON>
<TEXTFIELD ID="MESSAGE" X="65" Y="370" WIDTH="320" HEIGHT="21" COLOR="FF8855" BGCOLOR="222222"/>
<TEXTAREA ID="MESSAGES" X="8" Y="11" WIDTH="368" HEIGHT="350" COLOR="FFFFFF" BGCOLOR="001122" JOINMSG=" has joined the chatroom." QUITMSG=" has left the chatroom." PRIVATEMSG="Next messages are sent to : " ALLMSG="Next messages are sent to ALL chatroom users."/>
<LIST ID="USERS" X="402" Y="100" WIDTH="100" HEIGHT="240" COLOR="DDEEFF" BGCOLOR="001122" TITLE="> ALL USERS" SEPARATOR="==========="/>
</CHATPANEL>

</JCBSKIN>

Comics skin
- Login Panel from jChatBox client applet skin -


Multilanguage note : If you want your skin to support jChatBox multilanguage feature then replace all green labels above by the word "multilanguage"
. For instance, the first <LABEL> in <CHATPANEL> will become :
<LABEL ID="MESSAGE" X="4" Y="370" WIDTH="70" HEIGHT="22" COLOR="DDEEFF">multilanguage</LABEL>
You could find a complete sample through the multilanguage applet skin.

[News] [Applets] [Servlets] [Services] [Projects] [Links] [About]

Copyright © JavaZOOM 1999-2003

Java is a trademark of Sun Microsystems,Inc. All other company and/or product names are the property of their respective owners.