Appendix B. Online customer support application example 463
Similar to the customer chat window, we use the ChatArea class to display the
chat transcript and standard AWT components for the input field and buttons.
The Send button performs the same function, sending a line of text to the
customer. The Send Page button brings up a dialog box with a predefined list of
URLs to send the customer. The Hang Up button terminates the chat, and the
Select All and Copy buttons allow the agent to easily copy the contents of the
chat transcript to the clipboard.
Agent attributes
The agent applet sets the attributes shown in Table B-2.
Table B-2 Agent applet attributes
Agent state machine
The agent applet has three states, as shown in Figure B-8 on page 464.
Attribute constant ID Type Description
STATE 1 INT Applet state
(1=ready,
2=responding to
chat, and
3=chatting)
NAME 2 STRING Agent name
CUSTOMER_NAME 3 STRING Name of the
current customer
COMPANY 4 STRING Company name of
the current
customer