@Override
        public void messageReceived(Client source, Message m) {
            ChatMessage chat = (ChatMessage) m;

            System.out.println("Received:" + chat);

            // One of the least efficient ways to add text to a
            // JEditorPane
            chatMessages.append("<font color='#00a000'>" + (m.isReliable() ? "TCP" : "UDP") + "</font>");
            chatMessages.append(" -- <font color='#000080'><b>" + chat.getName() + "</b></font> : ");
            chatMessages.append(chat.getMessage());
            chatMessages.append("<br />");
            String s = "<html><body>" + chatMessages + "</body></html>";
            chatLog.setText(s);

            // Set selection to the end so that the scroll panel will scroll
            // down.
            chatLog.select(s.length(), s.length());
        }
A simple test chat server.  When SM implements a set
 of standard chat classes this can become a lot simpler.

 @version   $Revision$
 @author    Paul Speed
jme3-examples/src/main/java/jme3test/network/TestChatClient.java