I have to make the EventDispatchThread to wait till it gets response from the server. How do I do this?
You don't. Having the event dispatching
thread wait (for anything) is basically having the GUI wait. You don't want to cause the GUI to freeze.
To solve it, you have to remove the part of the code that updates the combo box. Place this code into a runnable object. And then, in your timer task, when you get the response from the server, instantiate and register this runnable object to be executed by the event dispatching thread. (See the SwingUtilites class for info on how to do this)
Henry
[ February 23, 2008: Message edited by: Henry Wong ]