I'm new to Java and I'm doing some online courses. I'm designing a CHat Client. I've completed the Server portion and Login, and I'm now on the chat window. I'm trying to figure out how to add a UDP listener in the Window. I put the code below, and also where I'm having problems.
I don't have the Listener code in it, because I tried so many different ways that I just started fresh. See comments in the code below where I mention I need help.

Thanks...Kip

public class GUIChat {

private JFrame frame;
private JTextField textField;
private JList grouplist;
String username;
String groupname;
private JEditorPane editorPane;
private JTextField enterText;
private JTextArea readChat;
private JList list;

/**
* Launch the application.
*/
public static void main(final String username, final String groupname) {

EventQueue.invokeLater(new Runnable() {
public void run() {
try {
GUIChat window = new GUIChat(username, groupname);
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the application.
*/
public GUIChat(String username, String groupname) throws Exception{

/**
* Initialize the contents of the frame.
*/

this.groupname = groupname;
this.username = username;

System.out.println("GROUP: " + groupname);
System.out.println("username: " + username);
frame = new JFrame();
frame.setBounds(100, 100, 764, 489);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JLabel label = new JLabel("URL:");
label.setBounds(10, 11, 29, 14);
frame.getContentPane().add(label);

// textField = new JTextField();
// textField.setBounds(39, 8, 437, 20);
// frame.getContentPane().add(textField);
// textField.setColumns(10);

textField = new JTextField("http://");
textField.setBounds(39, 8, 437, 20);
frame.getContentPane().add(textField);
textField.setColumns(10);

editorPane = new JEditorPane();
editorPane.setBounds(10, 36, 547, 218);
frame.getContentPane().add(editorPane);
editorPane.setEditable( false );
editorPane.addHyperlinkListener(
new HyperlinkListener() { //lets the user click on a link in the window
public void hyperlinkUpdate( HyperlinkEvent e )
{
if ( e.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED )
getURL( e.getURL().toString() );
}
}
);



JLabel lblEnterText = new JLabel("Enter Text:");
lblEnterText.setBounds(10, 397, 64, 25);
frame.getContentPane().add(lblEnterText);

// JButton btnSend = new JButton("Send");
// btnSend.setBounds(486, 7, 71, 23);
// frame.getContentPane().add(btnSend);
JButton btnSend = new JButton("Send");
btnSend.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //gets the URL text from the textField and sends it out to the users in the group
getURL(textField.getText());
try{
// sendURL(textField.getText());
}
catch (Exception e1) {
e1.printStackTrace();
}
}

});
btnSend.setBounds(486, 7, 71, 23);
frame.getContentPane().add(btnSend);


String[] GroupsString = CheckGroups();
// List list = new List();
JList list = new JList(GroupsString);
list.setBounds(576, 8, 162, 422);
frame.getContentPane().add(list);

JTextArea textArea = new JTextArea();
textArea.setBounds(10, 284, 547, 102);
frame.getContentPane().add(textArea);

JTextArea textArea_1 = new JTextArea();
textArea_1.setBounds(84, 397, 473, 25);
frame.getContentPane().add(textArea_1);

JLabel lblChatMessages = new JLabel("Chat Messages");
lblChatMessages.setBounds(10, 265, 106, 20);
frame.getContentPane().add(lblChatMessages);

// This is where I'm having problems at. This draws the chat pane just fine
// However, I can't seem to figure out how to add a UDP listener to it.
// When I add the UDP listener, this won't even come up.

JEditorPane editorPane = new JEditorPane();
editorPane.setBounds(10, 36, 547, 218);
frame.getContentPane().add(editorPane);
}

private void getURL( String location )
{
// setCursor( Cursor.getPredefinedCursor(
// Cursor.WAIT_CURSOR ) );

try {
editorPane.setPage( location );
textField.setText( location );
}
catch ( IOException io ) {
// JOptionPane.showMessageDialog( this,
// "Error retrieving specified URL","Re-enter URL and try again.",JOptionPane.ERROR_MESSAGE );
}

// setCursor( Cursor.getPredefinedCursor(
// Cursor.DEFAULT_CURSOR ) );
}

public String[] CheckGroups()throws Exception
{
String response;
String[] UserList;
String Groups;
String sentence;
String server = "localhost";
int Port = 32470;

Socket clientSocket = new Socket(server,Port);
PrintWriter outToServer = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

response = inFromServer.readLine();
System.out.println("FROM SERVER: " + response);
sentence = "grouplist:" + groupname;
outToServer.println(sentence);
Groups = inFromServer.readLine();
System.out.println("FROM SERVER: " + Groups);
sentence = "bye";
outToServer.println(sentence);
// Convert the response into an array
UserList = Groups.split(":");
// Split the UserList into individual users
// This isn't working. Got to late. Trying to
// split just ther usernames out.
for (String user : UserList)
{
//Split user out here
// Then modify UserList below to return just users
//
}

return UserList;

}
}