| Author |
simultaneosly running server class and JFrame, the JFrame wont show the components.
|
Roldan Baldo
Ranch Hand
Joined: Aug 11, 2009
Posts: 99
|
|
SERVER
CONNECTIONHANDLER
and a Simple JFrame
my main class here
why is it that the JFrame will not show its components properly,? the server is running. but i have no components seen in JFrame
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Your GUI code is not being executed in the Event Dispatcher Thread. Sure, you enter the EDT. But then you launch another thread that does the GUI work.
Scratch that. You are creating the GUI in the EDT - the "new ui()" does that. The thread that will be "running" it will not do anything, since ui's run() method does absolutely nothing.
But this isn't your real code; for one, Server doesn't implement Runnable so line 6 of your Main class will not compile. PostRealCode.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Roldan Baldo
Ranch Hand
Joined: Aug 11, 2009
Posts: 99
|
|
sorry i forgot the extends thread in the server, now its ok. my real code is complicated though. how will the GUI work as i wanted to?
thanks.
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3041
|
|
You will have to post real code which shows the problem. I copy the code you put up here and the frame and button get displayed correctly.
|
Steve
|
 |
 |
|
|
subject: simultaneosly running server class and JFrame, the JFrame wont show the components.
|
|
|