title: JavaFX GUI stuck
body: <p>I'm new here and I'm new to Java programming but I had to sign up only to ask you this cause it bothers me for days.
  Anyway, I am writing TCP Client. I made two threads: one for reading from System.in and sending to socket, and other one for reading from socket and writing to System.out.
  That worked fine but now I need to make a GUI and I know that I need to use Task and/or Service if I want to keep my GUI interactive, but I don't know how to make my threads as Service.
  Here's code (that worked in terminal):</p>
  
  <pre><code>public static class ReadThread extends Thread
  {
      BufferedReader in;
      String word;
  
      ReadThread(BufferedReader in)
      {
          this.in = in;
      }
  
      @Override
      public void run()
      {
          try {
              while((word = in.readLine()) != null)
                  System.out.println(word);
          } catch (IOException ex) {
              Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  }
  </code></pre>
  
  <p>Similar to this, I made WriteThread but I don't want to make this post messy so...
  Anyway, when I tried to implement this as a Service, I had to make "in" a final which generated some other errors and so on and so on.
  I'd appreciate if you'd help me on my particular case cause I probably read all the JavaFX GUI problems on this site haha
  Thanks in advance and sorry for a long post! :D</p>