Results 1 to 3 of 3
- 12-13-2011, 01:19 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 26
- Rep Power
- 0
Can't seem to get my array table to show up :(
Hi guys, here's a link to a section of my code:
>>>> Link Removed<<<< Please post code here
Whenever i run my program, the inputs work, but I get this error saying
"Exception in thread "main" java.lang.NullPointerException
at game.printGrid(game.java:66)
at gameUser.main(gameUser.java:25)"
In my user class game, I call the method from the other class to show output. Here is my code of calling the method.
gameObject = new game(1, 2);
gameObject.enterValue();
gameObject.printGrid();Last edited by Norm; 12-13-2011 at 02:06 AM.
- 12-13-2011, 02:08 AM #2
Re: Can't seem to get my array table to show up :(
There is a variable with a null value at line 66 in the program. Look at line 66 and see what variable is null and backtrack in the code to see why that variable does not have a valid value. If you can not see which variable is null add a println statement just before line 66 and print out all the variables used on line 66.Exception in thread "main" java.lang.NullPointerException
at game.printGrid(game.java:66)
- 12-13-2011, 02:34 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: Can't seem to get my array table to show up :(
Look at the following line numbers in your code.
Try to manipulate them logically and see what is the result in each steps. Use of a paper and pencil make sense a lot. Then you can find the solutions yourself while learning something new. If you don't know what is the exception means, please have a look at the Java Doc.at game.printGrid(game.java:66)
at gameUser.main(gameUser.java:25)"
Similar Threads
-
how to fill and show an array with graphic components?
By randomjavaguy in forum New To JavaReplies: 2Last Post: 11-08-2010, 09:19 AM -
array table and paint?
By reik6149 in forum New To JavaReplies: 1Last Post: 09-16-2010, 01:55 PM -
NFL 2D array standings table
By ber1023 in forum New To JavaReplies: 5Last Post: 01-07-2010, 04:45 AM -
Data from a model class won't show up in the table
By ayampanggang in forum AWT / SwingReplies: 3Last Post: 11-27-2008, 08:20 PM -
String array for Choice, JOptionPane doesn't show
By themburu in forum Java AppletsReplies: 5Last Post: 05-29-2008, 01:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks