Results 1 to 3 of 3
  1. #1
    juxta is offline Member
    Join Date
    Nov 2011
    Rep Power

    Default 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(
    at gameUser.main("

    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);
    Last edited by Norm; 12-13-2011 at 03:06 AM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Can't seem to get my array table to show up :(

    Exception in thread "main" java.lang.NullPointerException
    at game.printGrid(
    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.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power

    Default Re: Can't seem to get my array table to show up :(

    Look at the following line numbers in your code.

    at game.printGrid(
    at gameUser.main("
    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.

Similar Threads

  1. how to fill and show an array with graphic components?
    By randomjavaguy in forum New To Java
    Replies: 2
    Last Post: 11-08-2010, 10:19 AM
  2. array table and paint?
    By reik6149 in forum New To Java
    Replies: 1
    Last Post: 09-16-2010, 02:55 PM
  3. NFL 2D array standings table
    By ber1023 in forum New To Java
    Replies: 5
    Last Post: 01-07-2010, 05:45 AM
  4. Data from a model class won't show up in the table
    By ayampanggang in forum AWT / Swing
    Replies: 3
    Last Post: 11-27-2008, 09:20 PM
  5. String array for Choice, JOptionPane doesn't show
    By themburu in forum Java Applets
    Replies: 5
    Last Post: 05-29-2008, 02:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts