Added the heartbeat task to the connector task since it has to be run after the connection is established respectively stopped before the connection gets closed.
Use the Executor class to run show windows instead the AWT class. This way, everything is done by the same class.
Corrected the field values and tested aginst it.
Added getters and setters for the HeartbeatTask. A reference has to be stored somewhere to end this task later.