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();
  1. You should assign values double x = 1.0;. I can see double x = 1; everywhere which could give you unexpected results.

swing – Java Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

Leave a Reply

Your email address will not be published.