Ok, so I have my code for the timer
computer = new Timer (4000, this);
computer.start ();
The timer starts at the end of a method, and is supposed to start another method via actionlistener after 4 seconds, the problem is, after 4 seconds, the timer gives a null to actionlistener.I figured this out by adding a println in actionlistener
This is my code in actionlistener, and many more
if (event.equals ("computer"))
{
System.out.println ("Timer has finished");
ptarget ();
}
but i get an error of null pointer becouse the event is null
what am i doing wrong?