title: java updating UI components from another thread
body: <p>I found many answers about my question, but I still don't understand why my application does not throw any exceptions.
  I created a new java form application in NetBeans 8. 
  My form is created and displayed in main method like this:</p>
  
  <pre><code>public static void main(String args[])
      {
          /* Set the Nimbus look and feel */
          //&lt;editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "&gt;
          /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
           * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
           */
          try
          {
              for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
              {
                  if ("Nimbus".equals(info.getName()))
                  {
                      javax.swing.UIManager.setLookAndFeel(info.getClassName());
                      break;
                  }
              }
          }
          catch (ClassNotFoundException ex)
          {
              java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          catch (InstantiationException ex)
          {
              java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          catch (IllegalAccessException ex)
          {
              java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          catch (javax.swing.UnsupportedLookAndFeelException ex)
          {
              java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          //&lt;/editor-fold&gt;
  
          /* Create and display the form */
          java.awt.EventQueue.invokeLater(new Runnable()
          {
              public void run()
              {
                  new MainForm().setVisible(true);     
              }
          });
      }
  </code></pre>
  
  <p>So, this new Runnable creates new MainForm and sets it visible. </p>
  
  <p>Then, in my code I start new threads which updates some jButtons and jTextFields. Code below:</p>
  
  <pre><code>private void updateUI() {
          updateUIThread = new Thread(() -&gt;
          { 
              while (true) {
                  try {
                      jtfIP.setEnabled(!Start &amp;&amp; !autoRec);
                      jtfPort.setEnabled(!Start &amp;&amp; !autoRec);
                      jtfSlaveID.setEnabled(!Start &amp;&amp; !autoRec);
                      jtfTimeout.setEnabled(!Start &amp;&amp; !autoRec);
                      jtfReqInterval.setEnabled(!Start &amp;&amp; !autoRec);
                      jCheckBox1.setEnabled(!Start &amp;&amp; !autoRec);
                      jCBReconnect.setEnabled(!Start &amp;&amp; !autoRec);
  
                      if (db != null) {
                          if (!db.getIsOpen()) {
                              jPBD.setBackground(Color.RED);
                              jPBD.setForeground(Color.WHITE);
                              jPBD.setText("ER");
                          } else {
                              jPBD.setBackground(Color.GREEN);
                              jPBD.setForeground(Color.BLACK);
                              jPBD.setText("OK ");
                          }
                      } else {
                          jPBD.setBackground(Color.RED);
                          jPBD.setForeground(Color.WHITE);
                          jPBD.setText(" ER ");
                      }
  
  
                      if (autoRec){
                          jbtnConnect.setText("Auto");
                          if (Start &amp;&amp; Connected) {
                              jbtnConnect.setForeground(Color.BLACK);
                              jbtnConnect.setBackground(Color.GREEN);
                          } else {       
                              jbtnConnect.setForeground(Color.WHITE);
                              jbtnConnect.setBackground(Color.RED);
                          }
                      } else {
                          if (Start) {
                              jbtnConnect.setText("Disconnect");
                              jbtnConnect.setForeground(Color.BLACK);
                              jbtnConnect.setBackground(Color.GREEN);
  
                          } else {
                              jbtnConnect.setText("Connect");
                              jbtnConnect.setForeground(Color.WHITE);
                              jbtnConnect.setBackground(Color.RED);
                          }
                      }
  
                      jtfErroriCitire.setText(String.valueOf(totalErrors));
  
                      try
                      {
                          Thread.sleep(300);
                          jPanel4.repaint(1);
                      }
                      catch (InterruptedException ex)
                      {
                          Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
                      }
                  }
                  catch (Exception ex) {
                      Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
                  }
              }
          });
          updateUIThread.start();
      }
  </code></pre>
  
  <p>And there are other threads started like this above and where I get different values which are updated in the above thread.</p>
  
  <p>My question is why my code does not throw any exception regarding UI elements which are updated from another thread? I did NOT use <code>SwingUtilities.invokeLater(new Runnable() { //code here });</code>
  And my code executes perfectly...</p>
  
  <p>Thank you!</p>