Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    I think they are different. This statement from post#15:

    if(x <= 20){
    is NOT in post#9.

    You said that the code in post#9 worked
    The code in post #15 does not work. Add some printlns to...
  2. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    You'll have to post the code if you want any help with it.

    Did you see this in my last post?
    If the code in post#9 printed out correct X&Y values for the corners,
    why didn't you use the logic...
  3. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    Is it being assigned a null value?
    Object obj1 = null;
    Object obj2 = obj1; // obj2 will be null here because obj1 is null

    Did you see this in my last post?
    If the code in post#9 printed out...
  4. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    What variable on line 46 has a null value? Add a println to print out the values of all the variables on line 46 if you can't tell which variable could be null.


    If the code in post#9 printed...
  5. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    Not much without the code.

    What variable is null and why is it null?

    I'm done for tonight. Back tomorrow.
  6. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    If it has any value, it won't be null and cause a NullPointerException.

    If you don't post the full text of the error message and the code, there is very little anyone can do to help you.
  7. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    The default value for object variables is null. If they are not assigned a non-null value, their value will still be null.
    Check the logic and add printlns to show where dbImage is given a value.
  8. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    What printed out in the testing program? Can you post the testing program and its output?

    Also post the current version of your code
    and the full text of the error messages.
  9. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    To work out the logic you first need to make a drawing and label the upper left corner of each square.
    The look at the relationship of the x an y values for all the squares in the columns on each...
  10. Replies
    21
    Views
    1,689

    Re: Need help on simple game for Practice

    Look at line 43 and find the variable with the null value. Then backtrack in the code to find out why that variable does not have a valid non-null value.
Results 1 to 10 of 10