I have allways assumed that this exception occurs when memory is not allocated for an array before it is used. Now after I added the code that alocated the memory where it was needed, it still threw the exception, so I added lines 7-15 to this:
public void setOutline(int aniID, int x, int y, int w, int h)
{
xloc = x;
yloc = y;
width[aniID] = w;
height[aniID] = h;
try
{
outline[aniID].setRect(x,y,w,h);
}
catch(NullPointerException exc)
{
outline = new Rectangle[width.length];
outline[aniID].setRect(x,y,w,h);
}
}
and lo and behold it is still throwing the same exception (now coming from line 14) after memory was allocated on the previous line. How is this happening, Ty for any help?