Reputation: 27
I'm making a server-client application project in netbeans. I made some Jpanel, and some other stuff (buttons, textfield, textarea, menu) on my JFrame with the netbeans gui builder. When I push the new server button the whole JFrame and the all of its components are got frozen, but the server-client part is working on the background. I think there is a problem about the threads or something, but I've not really understood what i'm supposed to do.
Upvotes: 0
Views: 197
Reputation: 285403
The problem is likely that your server-client code is in fact not working in the background but instead working on the Swing event thread. You can test this you know with a SwingUtilities method: SwingUtilities.isEventDispatchThread()
Also:
join()
calls with a background thread?get()
method?The details of your code will likely help us give you more specific advice. To learn what you're supposed to do, please read, Lesson: Concurrency in Swing
Upvotes: 6