lblPt1.setIcon(bd.pt1.getImage());
works while
lblPt1.setIcon(bd.pts[0].getImage());
throws a NullPointerException
pts[] is an array containing "Point" objects pt1 through pt24.
I would like to handle it with this for loop where pointLbls[] is an array of JLabels:
for (int i = 0; i < 24; i++)
pointLbls[i].setIcon(bd.pts[i].getImage());
I have determined that it is the object that is null, not its associated image. What am I doing wrong? I am rather new to programming.