Your right, that would be the reason. We might be able to fix this though. What if you overroad the update(Graphics g) method instead of the paint(Graphics g) method? In order to prevoke that method,...
Type: Posts; User: aussiemcgr
Your right, that would be the reason. We might be able to fix this though. What if you overroad the update(Graphics g) method instead of the paint(Graphics g) method? In order to prevoke that method,...
2 things...
1) Incase you dont already know, when you get a NullPointer like that, the only one we care about is the first occurance because that is the most relevent to what we are doing. The only...
Then check the GUI like I suggested while you were writing this. If the problem isnt with our set variables, it must be with the GUI.
You know, your on to something there, infact, the more I look at it, the more GUI problems I'm seeing.
Snake is a JFrame. So why are we calling Container c = getContentPane();? In fact, Snake...
Well, we need to figure out where the NullPointers are at. To do this, we either set up a bunch of try/catch statements or throw in a bunch of System.out.println's. I suggest that latter.
To place...
um, do you ever set inGame to true? Cause if not, then thats your reason.