But, how do I run the server and then run the GUI client? You don't. Not as part of the same JVM instance. Once you invoke
java -jar <path> server
you've started a server, period. It's not expected to be used by any local GUI; it just handles clients over the network. If you want to start up a GUI attached to that server, then open a new command shell window, and type
java -jar <path>
to start a new (networked) client, and have it connect to the server. You can't directly attach a GUI to the server once it's started in network mode - you have to go through the network. Alternately, you can start it in local mode
java -jar <path> alone
and in this case once it's started this process will be local-only; it will have a GUI but you can't tell it to start networking later.
That really is the assignment point of the two modes. I think we're interpreting the question differently. We need to design the components so that they can interact in either mode. However given the command options we are instructed to implement, there's no need (or possibility, IMO) to be able to switch from one mode to the other
once a process has been started. The code must be flexible; a process running the code need not be, once it's started.
Ummm, I think.