I found the problem in my code!
I had built up an array of objects:
Table[] table = new table[tableNo];
but I hadn't intialised them in the for loop! whoops!
Anyway the code now works and is as follows:
Table[] table = new Table[tableNo];
for(i = 0; i < (tableNo); i++)
{
table[i] = new Table();
tmpVector2.set((-2.0f + i), 0.0f, 0.0f);
objRoot.addChild(table[i].Furniture(tmpVector2));
}
Sorted!
KP
--- Karl Parry <[EMAIL PROTECTED]> wrote: > Doing
that:
>
> for(i = 0; i < tableNo; i++)
>
> Gives a Null Pointer Exception when the program is
> run... I can't seem to shake it!
> Any ideas?
> KP
>
>
> --- "Raj N. Vaidya" <[EMAIL PROTECTED]> wrote: >
> >for(i = 0; i > tableNo; i++)
> >
> > Typo ? Did you mean "i < tableNo" ?
> >
> > Regards
> >
> > Vaidya
> >
> >
>
===========================================================================
> > To unsubscribe, send email to
> [EMAIL PROTECTED]
> > and include in the body
> > of the message "signoff JAVA3D-INTEREST". For
> > general help, send email to
> > [EMAIL PROTECTED] and include in the body of
> the
> > message "help".
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff JAVA3D-INTEREST". For
> general help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".