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 problem or I just missing something….
Thanks…
I am trying to create a panel while I have already connected to a
Share
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.
SwingWorkerandSwingUtilties) 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: