import java.awt.* ;
import java.net.* ;
import java.applet.* ;
import java.awt.event.* ;
import java.io.* ;
public Client
( String host,
int port
) { add( "North" , tf) ;
add( "Center" , ta) ;
processMessage( e.getActionCommand ( ) ) ;
}
}
) ;
try {
socket
= new Socket ( host, port
) ; System .
out .
println ( "Connected..." ) ;
}
}
private void processMessage
( String message
) { try {
dout.writeUTF ( message) ;
tf.setText ( "" ) ;
}
}
public void run( ) {
try {
while ( true ) {
String message
= iD.
readUTF ( ) ; ta.append ( message+ "\n " ) ;
}
}
{
}
}
}
CgppbXBvcnQgamF2YS5hd3QuKjsKaW1wb3J0IGphdmEubmV0Lio7CmltcG9ydCBqYXZhLmFwcGxldC4qOwppbXBvcnQgamF2YS5hd3QuZXZlbnQuKjsKaW1wb3J0IGphdmEuaW8uKjsKCnB1YmxpYyBjbGFzcyBDbGllbnQgZXh0ZW5kcyBQYW5lbCBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKCiAgICBwcml2YXRlIFRleHRGaWVsZCB0ZiA9IG5ldyBUZXh0RmllbGQoKTsKICAgIHByaXZhdGUgVGV4dEFyZWEgdGEgPSBuZXcgVGV4dEFyZWEoKTsKCiAgICBwcml2YXRlIFNvY2tldCBzb2NrZXQ7CgogICAgcHJpdmF0ZSBEYXRhT3V0cHV0U3RyZWFtIGRvdXQ7CiAgICBwcml2YXRlIERhdGFJbnB1dFN0cmVhbSBpRDsKCgogICAgcHVibGljIENsaWVudCggU3RyaW5nIGhvc3QsIGludCBwb3J0KSB7CiAgICAgICAgc2V0TGF5b3V0KG5ldyBCb3JkZXJMYXlvdXQoKSk7CiAgICAgICAgYWRkKCJOb3J0aCIsIHRmKTsKICAgICAgICBhZGQoIkNlbnRlciIsIHRhKTsKCiAgICAgICAgdGYuYWRkQWN0aW9uTGlzdGVuZXIobmV3IEFjdGlvbkxpc3RlbmVyKCkgewogICAgICAgICAgICBwdWJsaWMgdm9pZCBhY3Rpb25QZXJmb3JtZWQoQWN0aW9uRXZlbnQgZSkgewogICAgICAgICAgICAgICAgcHJvY2Vzc01lc3NhZ2UoZS5nZXRBY3Rpb25Db21tYW5kKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICk7CgogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHNvY2tldCA9IG5ldyBTb2NrZXQoaG9zdCwgcG9ydCk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQ29ubmVjdGVkLi4uIik7CgogICAgICAgICAgICBpRCA9IG5ldyBEYXRhSW5wdXRTdHJlYW0oc29ja2V0LmdldElucHV0U3RyZWFtKCkpOwogICAgICAgICAgICBkb3V0ID0gbmV3IERhdGFPdXRwdXRTdHJlYW0oc29ja2V0LmdldE91dHB1dFN0cmVhbSgpKTsKCiAgICAgICAgICAgIG5ldyBUaHJlYWQodGhpcykuc3RhcnQoKTsKICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihlKTsKICAgICAgICB9CgogICAgfQogICAgICAgIHByaXZhdGUgdm9pZCBwcm9jZXNzTWVzc2FnZSggU3RyaW5nIG1lc3NhZ2UgKXsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGRvdXQud3JpdGVVVEYobWVzc2FnZSk7CiAgICAgICAgICAgICAgICB0Zi5zZXRUZXh0KCIiKTsKICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gaWUpIHsKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihpZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CgoKICAgICAgICBwdWJsaWMgdm9pZCBydW4oKXsKICAgICAgICAgICAgdHJ5ewogICAgICAgICAgICAgICAgd2hpbGUodHJ1ZSl7CiAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG1lc3NhZ2UgPSBpRC5yZWFkVVRGKCk7CiAgICAgICAgICAgICAgICAgICAgdGEuYXBwZW5kKG1lc3NhZ2UrIlxuIik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgY2F0Y2ggKElPRXhjZXB0aW9uIGllKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIGllKTsKICAgICAgICAgICAgfQoKICAgICAgICB9CgoKCiAgICB9CgoK