title: How can I get data from in one thread from another thread in Java?
body: <p>I have a simple client-server program. In one thread GUI is running, when I click "connect" button on GUI, I connect to server in new thread, after some time I receive some data from server and I want to pass it to GUI - how can I do that?</p>