Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Hi I keep running into this runtime error where lines 18 and 32 come out as java.lang.NULLPOINTEREXCEPTION and i dont know how to fix it

Hi I keep running into this runtime error where lines 18 and 32 come out as java.lang.NULLPOINTEREXCEPTION and i dont know how to fix it
image text in transcribed
heres a better picture with line numbers image text in transcribed
Me - BosicDebugging Edit Tools lex Options bile Undo Cut Copy port java.awt. port javax.swing. * Basic debugging exercise - There are 4 errors in this program. Find them, * correct them, and compile the program to verify that your program matches * the example from Bright space. Fill in your name below, then compress this * project and submit it to the proper dropbox folder Dauthor * Oversion 1.0 */ public class DebugMe extends JFrame private String message = "Congratulations, the program is working again.": int X: Image debug = new ImageIcon(this.getClass().getResource("debugipeg)).getImage(); Bluel: Terminal Window Basic Debugging ** * Constructor for objects of class DebugMe Option public DebugMe() X = 0; setSize(500, 500); setVisible(true): public static void main(String[] args) DebugMe myDebugMe - new DebugMe(); int y: public void paint (Graphics g) java.lang.NullPointerException ava desktop/javax.swing.ImageIcon.in at Debune.cinit DebuaMeJava:18) at Debudemain Debuenava ) java.lang.NullPointerException java.desktop/javax.swing. TrageIcon.in at Dabuse simts (Debude. Java13 at Debakemannene 2) super.paint(9): 9.drawstring("message", 100, 100); ava.lang.NullPointerException: ull (in javax.swing Imagelcon) Type here to search import java.awt.*; import javax.swing.*; * Basic debugging exercise - There are 4 errors in this program. Find them, * correct them, and compile the program to verify that your program matches * the example from Brightspace. Fill in your name below, then compress this * project and submit it to the proper dropbox folder. * @author * @version 1.0 * 13 public class DebugMe extends JFrame private String message = "Congratulations, the program is working again." ; Image debug = new ImageIcon(this.getClass().getResource("debug.jpeg")).getImage(): int x; Bluet Terminal Window - BasicDebugging ** Options * Constructor for objects of class DebugMe public DebugMe() X = 0; setSize(500, 500): setVisible(true); public static void main(String[] args) DebugMe myDebugMe = new DebugMe(): int y: Can only enter input while your program java.lang.NullPointerException at java.desktop/javax.swing.ImageI at DebuaMe, sinit>(DebuaMe.java:18) at DebugMe.main(DebuaMe. Java 33) java.lang.NullPointerException at java.desktop/javax.swing.ImageId at DebuaMe, sinit>(DebuaMe java:18) at Debugle.main(Debugle.java:32) public void paint(Graphics g) super.paint(9): g.drawstring("message", 100, 100); java.lang.NullPointerException: null (in javax.swing.Imagelan

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students explore these related Databases questions