title: Gui blocked when starting Thread from button clicked event
body: <p>This may be a basic question but one that I am stuck on.</p>
  
  <p>I would like some more understanding on why the GUI is blocked when I start a new thread(runnable) from a button click event? and how do I overcome that? What am I doing wrong?</p>
  
  <p>The code below starts a new thread when it is clicked, however I would like to change the background color of a textbox when that button is clicked but I am unable to do that, also the main ui is unresponsive whilst that thread is running, I believed that I was implementing it correctly by starting a new thread so as to NOT block the main ui but I must have missed something out as this obviously not desired behaviour.</p>
  
  <p>Code:</p>
  
  <pre><code>private void startButtonEvent(ActionEvent evt) {
  
           ntmStatusText.setBackground(Color.green);// textbackground I want to change
  
          //Start Ntm Thread
           Thread thread = new Thread(new NtmThread());
             thread.start();
  
             while(thread.isAlive()){
  
                 System.out.println("thread still working");
  
             }
             System.out.println("thread stopped");
  
      }
  </code></pre>
  
  <p>How do I stop my Ui from becoming unresponsive when running threads?</p>