Question: How to solve this proplem in Java. Output Showing below Exception in thread main java.lang.NullPointerException at MazeGUI. (MazeGUI.java:34) at MazeGUI.main(MazeGUI.java:40) The code: public MazeGUI(){ this
How to solve this proplem in Java. Output Showing below
Exception in thread "main" java.lang.NullPointerException
at MazeGUI.
at MazeGUI.main(MazeGUI.java:40)
The code: public MazeGUI(){ this.setTitle("My GUI Maze"); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.setSize(700,700); panGrid.setLayout(new GridLayout(SIZE, SIZE)); initializeGrid(); this.add(panGrid); this.setVisible(true); } public static void main(String[] args){ new MazeGUI(); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
