开发者

Java Socket prevents panel?

I am trying to create a panel while I have already connected to a server with socket, but in java it shows frame but not inside of frame. Panel is only shown after socket closed, but I need it while it is open. How can I solve this? It is because of a thread prob开发者_高级运维lem or I just missing something.... Thanks...


Long-running tasks should never occur on the EDT. This includes blocking I/O operations. If such tasks do not modify any Swing components, simply use another thread. Otherwise, there are utilities available (e.g. SwingWorker and SwingUtilties) that will enable to you carry out long-running tasks in another thread, and then post the result as an action event on the EDT to modify any Swing components.

See also:

  • Concurrency in Swing
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜