Home > Back-end >  There is an error in Java: Java. Lang. NullPointerException
There is an error in Java: Java. Lang. NullPointerException

Time:09-18

Turn to the great god help answer:
Errors occur in this line:
G.d rawImage (new ImageIcon (getClass () getResource (image \ \ "" +" chessboard. JPG ")). The getImage (), 90, 60, 625, 700, this);

The console display:
The Exception in the thread "is the AWT - EventQueue - 0" Java. Lang. NullPointerException
The at Java desktop/javax.mail. Swing. ImageIcon. & lt; init> (ImageIcon. Java: 217)
The at DrawUI. Paint (DrawUI. Java: 31)

CodePudding user response:

Null pointer to a breakpoint, where is your which one object is empty, when empty calls a method will report this problem, it's look not to come out

CodePudding user response:

Null pointer exception is refers to the object instantiated, can't call the instance variables and methods, as long as see calls the method or variable object, there is ". "where did object instantiated,

CodePudding user response:

refer to the original poster qq_44950065 response:
turn great god help answer:
Errors occur in this line:
G.d rawImage (new ImageIcon (getClass () getResource (image \ \ "" +" chessboard. JPG ")). The getImage (), 90, 60, 625, 700, this);

The console display:
The Exception in the thread "is the AWT - EventQueue - 0" Java. Lang. NullPointerException
The at Java desktop/javax.mail. Swing. ImageIcon. & lt; init> (ImageIcon. Java: 217)
The at DrawUI. Paint (DrawUI. Java: 31)



General should be a picture file path errors, resulting in the import file is empty,

CodePudding user response:

Blind guess couldn't find the picture
  • Related