this is mainly due to the fact that close event on gui only depose the gui, but not the thread. i think an ideal solution would be change the close handler to depose the gui, and at the same time, throw an exception (not runime), then serverthread can catch the exception and close itself.
但是我太笨啦,试了好久也没有做出来。
this is only a minor issue and doesn't cause any problem on functionality, so this should be of low importance.