Hello everybody.
I'm new to java programming. These days I'm developing a client server application using java. Client side is at most finish now. Server side logic is also designed and implemented successfully.
But I'm in a trouble regarding following stuff.

The server runs an infinite loop. it always checking for incoming request. I need to add tow buttons on my interface "Start" and "Stop" so that user can start the server and stop it when he want.
I added my server logic to start buttons click event. and set a global variable which can be reset by stop button.
But the problem is because of infinite loop I'm unable to click the stop button once the server is started. Even close or minimize buttons dose not work......
Please help me....

I guess I may want to work with thrads in order to solve this problem. I refered some articals on java threads. but Still I can't understand how threads can help me.

If you can recommand a link, it would be better
Any answer will be highly appreciated

Thanks in advance

Perform you function in a Swing Worker Thread, not on the Event Dispatch Thread. I have no time to explain this now, but Google will help.