The getGraphics() method in my constructor is returning a nullPointerException and I can't figure out why. This class is extending a JPanel and I thought calling super() would fix it because it makes sense that the JPanel would initialize its graphics object in the constructor, but that didn't fix it. The line that produces the error is in bold. I've narrowed it down to the getGraphics() method is returning null, so the next line that calls the graphics object is actually the one that produces the error.
Can someone please help me figure out why this is returning null?
P.S. print(
String) is a method I made that draws lines of text on the graphics object, similar to System.out.println(String) in the command prompt.
[ August 23, 2007: Message edited by: Derek Boring ]
[ August 23, 2007: Message edited by: Derek Boring ]