Timer not ticking in GUI edited JFrame
The below code constructs and starts a simple Timer in the 'myClass()' constructor method. As soon as the first timer interval fires, a run time error is thrown.
The problematic class was constructed by the NetBeans GUI editor. I tested the same code on another class I manually coded that also extends JFrame and it functioned correctly. Does anyone have a theory to why this may happen?
The error reads: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
public class myClass extends JFrame, implements ActionListener
private javax.swing.Timer timer
timer = new javax.swing.Timer(1000,this);
public void actionPerformed(Actionevent e)
// perform task