Solved

How to thread a gui socket program

Posted on 2010-09-22
2
316 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
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 24
network + 7 81
Unable to start eclipse ? 17 134
what is the difference between "sudo su" and "su - root" 6 106
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now