swing – Java Exception in thread AWT-EventQueue-0 java.lang.NullPointerException
swing – Java Exception in thread AWT-EventQueue-0 java.lang.NullPointerException
Your Level l
object seems to be null
. As you havent initialized it and you are trying to use it in moveUp()
method throwing NullPointerException.
You should initialized it as follows.
Level l = new Level();
- You should assign values
double x = 1.0;
. I can seedouble x = 1;
everywhere which could give you unexpected results.