title: Integer cannot be derefereneced
body: <p>Wrong variable chosen on line <strong>tenSecs.set text(Integer.to string(i++)</strong>;</p>
  
  <p>The following code allows me to initialise a timer and when it is started, it adds one to the display, oneSecs. </p>
  
  <pre><code>    javax.swing.Timer tm = new javax.swing.Timer(1000, new ActionListener() {
     public void actionPerformed(ActionEvent evt) {
         AddOneActionPerformed(evt);
     } 
  });
  
  private void StartStopTimerActionPerformed(java.awt.event.ActionEvent evt) {                                               
  
  if (!tm.isRunning()) {
           tm.start();
      } else {
           tm.stop();
      }
  
          ScheduledExecutorService e= Executors.newSingleThreadScheduledExecutor(); //Start new scheduled executor service to invoke a timer that start wehn button is pressed
          e.scheduleAtFixedRate(new Runnable() {
  
              @Override
              public void run() {
                  //Follow this Override to do task
                  SwingUtilities.invokeLater(new Runnable() {
                      //Override will let the task run                
  
                          @Override
                          public void run() {
                              oneSecsDisplay.setIcon(new ImageIcon("images\\" + TextGrabber() + ".png"));
                              oneSecs.setText( DigitValue.getText());
  
                              int i = 0;
  
                              if (Integer.parseInt(oneSecs.getText()) == i) {
                                  tenSecs.setText(Integer.toString(i++));
                              }
                          }
                      });
                  }
              }, 0, 100, TimeUnit.MILLISECONDS); //Update will be for every 100 milliseconds concurrent to system time
  } 
  
  // Variables declaration - do not modify   
  private javax.swing.JTextField oneSecs;
  private javax.swing.JTextField tenSecs;
  // End of variables declaration
  </code></pre>