Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to thread a gui socket program

Posted on 2010-09-22
2
Medium Priority
?
361 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

886 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