Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multithreaded Server App (Gui)  RSS feed

 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey. Guys. Anyone that can Paste Coding On the following for me, because I have been Stuck on this section for 4weeks now. I just ask for Help on Creating a small gui. What should happen is JButton "Start Server" to be able to start an application server which will service multiple clients through a thread/threads. Thank you in advance. I have to finish this project by wednesday. Thanks again.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this is a desktop Swing application? If so, what are the "multiple clients" - from where are they connecting through sockets?

I'm not sure where exactly the problem is from your description; if it's in creating a GUI containing a JButton you may want to read up on Swing GUis in general: http://java.sun.com/docs/books/tutorial/uiswing/index.html
If it's in the multi-threaded client/server socket communication, see http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

As an aside, JavaRanch is NotACodeMill, so no one here is going to write the code for you. But we're happy to help if you tell us what you have so far, and where you're stuck making progress.
 
K. Tsang
Bartender
Posts: 3628
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing what you describe is fairly simple for me anyway. The Swing tutorial is a good start getting the JButton to work.

But the thing is so what if you press the button and start the server? Is there a client app to connect to the server? Another thing why need a button to start/stop server? Or why need a GUI for the server?
 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey. thank you. Let me elaborate more. Yes it's a desktop Application. Clients are supppoced to be connected through sockets. And secondly where am I stuck? I am stuck with the button. When i code the server intialisation in the eventhandler, everything runs smooth. The problem is when I add the accepting() block, because my server application then freezes, but still lets the clients in.
 
K. Tsang
Bartender
Posts: 3628
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thabo Matjuda wrote:The problem is when I add the accepting() block, because my server application then freezes, but still lets the clients in.


Then you better post what you have already in the accepting() block so we can help.
 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay I need a button/gui because those are my project specifications. Yes i have a client to connect to the server. I hope I have answered your questions DITMMER. Thank you.
 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay I will post it here.
 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys. Thanks. I believe I have fixed the Freezing Server problem. The thing is, my accept(block), had to be in a thread. Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!