If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

however... I need to have that little bit of code called elsewhere inside another class. The problem is that if I do that the program hangs. and I can't click the send button. I am confused. There is no problem in main... That code is called and then everything is fine however if I call it from the ConnectToServer class it screws everything up.

Maybe there is something I don't know? I have looked at ORielly's book learning java and haven't found anything that might help.

Use Threads. I'm in the middle of writing an AIM client myself, trying to get webcam support at this point in development. Make a class called IMConnection, or something, and implement the Runnable interface.

sweet! That did it...

I didn't understand that a thread had access to the variables from where it was created. What I need to do is re-read that chapter and I will, however once you pointed that out (via that fact that you where using that sort of code) I understood. I of course modified the class but it works spiffy!

Thank you very much.

Below is that class you gave me and I modified. OH! You notice I added the actionListener so we could click it!

// Pass the sendTextButtonHandler a refrence to the printWriter and the
// inputArea.. We could clean this up but for now it works!
sendTextButtonHandler.pOut = pOut;
sendTextButtonHandler.inputArea = inputArea;
sendTextButtonHandler.chatArea = chatArea;
}
}