@Override public void onIncomingChatRequest(IncomingChatRequestEvent event) throws Exception {
  ReceiveChat chat=event.accept();
  String line;
  while ((line=chat.readLine()) != null)   if (line.equalsIgnoreCase("done")) {
    chat.close();
    break;
  }
 else {
    int lineLength=line.length();
    chat.sendLine("Line '" + line + "' contains "+ lineLength+ " characters");
  }
}

@ Override public void onIncomingChatRequest ( IncomingChatRequestEvent event ) throws Exception { ReceiveChat chat = event . accept ( ) ; String line ; while ( ( line = chat . readLine ( ) ) != null ) if ( line . equalsIgnoreCase ( "done" ) ) { chat . close ( ) ; break ; } else { int lineLength = line . length ( ) ; chat . sendLine ( "Line '" + line + "' contains " + lineLength + " characters" ) ; } }
this basic example shows how to handle incoming dcc chat requests . it basically repeats what the user said and says how many characters are in their message
