• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multi Client/Server App  RSS feed

 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay. I have to create GUI in netbeans. Sort of a Server Doorway. GUI Contains "Start server" & "Stop server" buttons. When I click on "Start Server" A mulitiple client-server must start and at the same time connect to a database i created in sql2000. Now I need to know if I Should do this in the "Start button" actionPerformed or If I should create a separate class which extends THREAD & contains the VOID RUN() Method? Thank You.
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client starts the server? Really? What happens when multiple clients connect to the server, then the first client logs off and closes? The server closes too?
Consider this, if you do not create a new thread when your client responds to a button press, you are running the code on the Swing event handler thread, which means that your client GUI can't respond to any other events. Have a look at the Swing Tutorial chapter on Concurrency.
 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay thanks. Let me do this bit by bit. For now I need help on how to make my "Start Server" button, start a SERVER which supports multiple clients. I am lost on the coding logic. Then we will take on the rest Later. Gee thank you. OK Obviously I will do the Coding will be done in the actionPerformed method, but what's the logic there? Thanks again.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!