Solved

How to thread a gui socket program

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

770 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