I have an array of button that displays images after image query. Now I am trying to add a checkbox under each button so user can check if that's a relevant image. I was going to have an array of Jpanel where each Jpanel consist of one button and checkbox but I don't know how to incorporate all the components in my code.This is what I have so far:
resultPanel = new JPanel[10];
resultPanel[10].add(relevantFB);
resultPanel[10].add(button);
for (int i = 1; i < 101; i++) {
button[i] = new JButton(newIcon);
relevantFB[i] = new JCheckBox();
relevantFB[i].setText("Relevant Image" + i);
panelBottom1.add(button[i]);
button[i].addActionListener(new IconButtonHandler(i, newIcon));
relevantFB[i].addActionListener(new IconCheckboxHandler(i, newIcon));
buttonOrder[i] = i;
checkboxOrder[i]=i;
}