private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendButtonActionPerformed
        // Object containing all the data to be sent to the server
        ChatMessage m = new ChatMessage(messageTextField.getText(), connection.getSelf().getName());
        try {
            // Sends a raw object over the network to the server
            connection.sendObject(m);
            // clear the message box
            messageTextField.setText("");
        } catch (IOException ex) {
            Logger.getLogger(MainGUI.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_sendButtonActionPerformed