|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ChatRoomClient
A ChatRoomClient.
Field Summary | |
protected ChatRoomProtocol |
protocol
|
Constructor Summary | |
ChatRoomClient()
Constructs a new ChatRoomClient with the default values of IP and server port. |
|
ChatRoomClient(java.lang.String IP,
int port)
Constructs a new ChatRoomClient with the default values of IP and server port. |
Method Summary | |
void |
connect()
|
void |
disconnect()
Disconnect from the server. |
void |
displayMessage(java.lang.String message)
Update the UI by displaying the recieved message. |
java.lang.String |
getUserName()
Returns the client's user name. |
boolean |
isConnected()
Return true if the user connected to the server. |
void |
requestUserName()
Requests a name from the user by opening a Dialog box. |
void |
sendMessage(java.lang.String message)
Send a string message to the server. |
void |
setUI(ChatRoomClientGUI gui)
Sets the UI of this ChatRoomClient |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ChatRoomProtocol protocol
Constructor Detail |
public ChatRoomClient()
public ChatRoomClient(java.lang.String IP, int port)
Method Detail |
public void setUI(ChatRoomClientGUI gui)
public boolean isConnected()
public java.lang.String getUserName()
public void displayMessage(java.lang.String message)
message
- The message to add.public void requestUserName()
public void disconnect()
public void sendMessage(java.lang.String message)
message
- the string messagepublic void connect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |