title: SimpleStringProperty returns null outside the class
body: <p>I'm working on my first java project: a javafx application to monitor temperature and humidity measured by a sensor and a micro controller.<br></p>
  
  <p>The way I'm imagining it to work: <br>
  1. Collect the measures and store them in a <code>SimpleStringProperty</code> <br>
  2. In another class, somehow retrieve the measures with a getter <br>
  3. In that class, split it into two <code>SimpleIntegerProperty</code>s(temperature and humidity) <br>
  4. Assign them to displays in my controller with a getter <br></p>
  
  <p>I'm able to receive the measures and print them out in the console, but when I try to get the values outside the class it returns null.</p>
  
  <p>Not quite sure I got all the concepts right but here we go:<br></p>
  
  <p>I have one class for the server:</p>
  
  <pre><code>public class SuperServer {
      private ServerSocket server;
  
  
      public void start(){
          try{
              while (!server.isClosed()){
                  System.out.println("...");
                  Socket socket = server.accept();
                  RocketSocket rs = new RocketSocket(socket);
                  rs.start();
                  System.out.println(rs.getReceived() + " &lt;-SuperServer");
                  Thread.sleep(1000);
              }
              server.close();
          } catch (IOException | InterruptedException e) {
              e.printStackTrace();
          }
      }
  
      public SuperServer(int port)
          throws IOException {
          server = new ServerSocket(port);
      }
  }
  </code></pre>
  
  <p>Another class that creates new threads:</p>
  
  <pre><code>public class RocketSocket extends Thread {
      private Socket socket;
      private SimpleStringProperty received = new SimpleStringProperty();
  
      String getReceived() {
          return received.get();
      }
  
      SimpleStringProperty receivedProperty() {
          return received;
      }
  
      public void run() {
          try {
              DataInputStream in = new DataInputStream(socket.getInputStream());
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              while (!socket.isClosed()) {
                  String latest = br.readLine();
                  if(latest != null){
                      received.set(latest);
                      System.out.println(getReceived() + " &lt;-RocketSocket");
                  }
                  Thread.sleep(3000);
              }
              socket.close();
              in.close();
          } catch (IOException | InterruptedException e) {
              e.printStackTrace();
          }
      }
      RocketSocket(Socket socket) {
          this.socket = socket;
      }
  }
  </code></pre>
  
  <p>and the output:</p>
  
  <pre><code>...
  null &lt;-SuperServer
  47.50,21.20 &lt;-RocketSocket
  </code></pre>
  
  <p>Inside <code>RocketSocket</code>, <code>received</code> is updated, but why does it return null when i try to get it in <code>SuperServer</code>?<br></p>