Solved

How to thread a gui socket program

Posted on 2010-09-22
2
305 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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

744 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

13 Experts available now in Live!

Get 1:1 Help Now