Freezing when button is clicked

I understand why the program freezes when I click on one of my buttons, but fixing has gotten me stumped. In my program you will click on a button, it goes to the action listener, and sends information to a different program through a server, and then it calls a method to wait for the person using the other program to reply. However, since the action listener didnt finish and the other method is pausing the running of the program stops until the reply, basically freezing until a reply. I need to know how i can make the action listener finish, and still somehow call the method and not freeze, im totally stumped.

[625 byte] By [P.F.a] at [2007-11-26 20:50:52]
# 1
You may accomplish that by starting a new thread in the actionPerformed(), and talking to the server from the new thread. http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
jvaudrya at 2007-7-10 2:15:40 > top of Java-index,Desktop,Core GUI APIs...
# 2
that works, thank you
P.F.a at 2007-7-10 2:15:40 > top of Java-index,Desktop,Core GUI APIs...