File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Threads and inner classes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Threads and inner classes" Watch "Threads and inner classes" New topic
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.
 
IntelliJ Java IDE
 
subject: Threads and inner classes
 
Threads others viewed
Chat Application...
Sample Project
server values
Network program
reference problem within inner class
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture