First, it is good programming practice to keep the various components separated (separate class files for gui, chat etc..)
Second I would strongly recommend getting an IDE to develop with. I can easily recommend both Netbeans ( www.netbeans.org ) or Eclipse ( www.eclipse.org ) They will help you organize the many files that are likely to make up your project. They will also speed up your development with GUI editors, compiling and packaging. There is a learning curve, but there are excellent tutorials available to help.
I wrote a small chat client a while back and I implemented a Hashtable to contain User and socket (user was the key, socket the value) So, you could iterate through the hashtable keys to build the JTree of users.
To compile multiple .java files you would run the following command line: javac -d *.java
That is the simplest method. See javac -help for more details on compiling.
In order to use the various classes in the main() you would need to create objects representing your classes:
void main(String[] args){
MyGUIClass gui = new MyGUIClass();
gui.setVisible(true);
}
This snippet presumes that your class MyGUIClass extends one of the Java window classes (like JFrame).
Again, I would urge you to look into getting one of the IDE's mentioned above. It will make development much easier, as most of the details will be handled by it, leaving you free to work on implementing the important bits that hold everything together.