Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to thread a gui socket program

Posted on 2010-09-22
2
Medium Priority
?
357 Views
Last Modified: 2012-05-10
Hello,

I have written a gui socket program and I need the program to add multiple clients to the program.  I was reading how to thread socket program with no gui.  I was wondering how to do it with a gui program.  Any good tutorials or advice would be greatly appreciated.
0
Comment
Question by:brich744
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 33738286
I would use a SwingWorker to consume the stream and to update the gui
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 33739566
you would do it the same as the non-gui version. You just need to ensure when you want to update the gui you do it from the event dispatch thread
theres an example here that shows how to do it

http://helpdesk.objects.com.au/java/how-do-i-update-my-gui-from-any-thread
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question