0

I'm sort of new to programming, I know just basic knowledge of Java and Python and want to get into more depth in learning more about designing applications and machine learning. I'm currently using Visual Studio code as the coding environment. I'm slow into these kinds of things, so I'm having trouble figuring out why does the code not execute although there aren't any errors. When I run the code I get an error from the terminal saying 'Exception in thread "main" java.lang.NullPointerException: Cannot read field "parent" because "comp" is null' I was following a video I found on Youtube in how to create JFrame, but it doesn't run, I've already made a path to the Java development kit. Here's a screenshot

Supposedly when it runs it get its opens a new window or Jframe application displaying the features that were put into the code. I'm using java for this in Visual Studio Code.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Kate R
  • 1
  • 1
    You have a `NullPointerException`, you're going to need to learn how to deal with these, as they are very common. The stack trace is pointing you to where the error occurred (line 61 which is not visible in your screen shot - which is why you shouldn't post screen shots of your code). – MadProgrammer Nov 06 '22 at 23:10

0 Answers0