because I do not know what to put in it.
in addition I cannot run the chat anymore as
I have this
Exception in thread "Thread-2" java.lang.NullPointerException
Then do not remove those lines. I guess the problem was related to a netbeans bug. Same happened to me. It just did not ask me the ip address, then i removed those lines and it worked without those lines.
Cannot figure out how to do the boolean flag.
I noticed that you have a different logic there which should work too. You just seem to use "lastMessageSent" variable in Send class wrongly.
You already defined it as a class variable at the top of your class. When you use "String lastMessageSent = "";" and "String lastMessageSent = myGUI.lastMessageSent;" in your methods, you are defining a new variable called lastMessageSent. So do not use String keyword before your variable name while using it inside methods.
Good luck.