
-----------------------------------
BladeOfDeath
Sat Jan 08, 2005 9:51 pm

NullPointerException
-----------------------------------
I get this error every time I something with the paint command in "Ready To Program" which is the program I must use for my computer science course. A little help would be appreciated, if I could fix this problem I could get extra marks on my ISU.

-----------------------------------
wtd
Sat Jan 08, 2005 9:58 pm


-----------------------------------
Use the API reference: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html

-----------------------------------
BladeOfDeath
Wed Jan 12, 2005 12:44 pm


-----------------------------------
okay I looked at the site but I don't know how to fix it, mind telling me how?

-----------------------------------
wtd
Wed Jan 12, 2005 6:23 pm


-----------------------------------
My guess is that somewhere you've declared an object-type variable, but haven't used "new" to create it.  Like:

StringBuffer sb;

sb.append("Hello");

instead of:

StringBuffer sb = new StringBuffer();

sb.append("Hello");

-----------------------------------
BladeOfDeath
Wed Jan 12, 2005 6:41 pm


-----------------------------------
Well... I think it has something to do with the Image variables or something, because I've never had this error unless using graphics. I'll attach a copy of the code if you wanna check it out for yourself (the images are not enclosed).

-----------------------------------
wtd
Wed Jan 12, 2005 6:48 pm


-----------------------------------
Can I see a full copy of the error?

-----------------------------------
BladeOfDeath
Thu Jan 13, 2005 12:12 pm


-----------------------------------
it only shows at home, but when i get home ill send it. Thanks for the help though

-----------------------------------
MrPenisJr.
Thu Jan 13, 2005 6:19 pm


-----------------------------------
Just use some Java source code!

--MrPenisJr.
