| Author |
Threads and inner classes
|
Rikard Qvarforth
Ranch Hand
Joined: Jul 10, 2001
Posts: 107
|
|
Hi i hava a problem im writing a client server program. The problem is that in the client class i have a inner gui class that builts upp depending on parameters requested from the server. ex. class client void run(){ //initialise the socket //get in/out streams while(!close) objectinputstream.readobject()//listens for new commands/or objects that the server may send } class inner{ //construct the gui when user clics on a button ?? now i cant get the readstream because its wheting for commands from server ?? so i get the out stream and request the parameters from the server this works fine but how can the inner class now when its parameters has been recived ? or even better please tell me how to design this better
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 1855
|
|
|
My best guess is you are want to read some parameters from a server, and use the values to populate a GUI. Is that right? I'm not sure where the inner class comes in though. You ask how the inner class can know when the parameters have been received. Well, there are various callback strategies in Java, but here you should just have the same process that is reading the parameters, populate and and display the GUI. Implement the GUI as separate classes though. There's no need for an inner class here.
|
 |
 |
|
|
subject: Threads and inner classes
|
|
|