title: Invalid Thread Access error when changing Java SWT Label
body: <p>I want to run my program where the value of a label changes after the Timer goes off. But whenever the Timer runs I will keep getting the Invalid Thread access error and my label does not get updated.</p>
  
  <pre><code>protected void createContents() {
      &lt;--GUI codes --&gt;
  
      //Timer set to go every 10 seconds
        ActionListener taskPerformer = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                System.out.println("Timer");
  
                lblState.setText("On");
            }
        };
        new Timer(delay, taskPerformer).start();
  }
  </code></pre>