I am trying to move all the selected checkboxes from panel1 into panel2 and also removing the checkboxes from panel1 after the transfer. I made two arraylist to hold the checkboxes
ArrayList<JCheckBox> todo_box = new ArrayList<JCheckBox>();
ArrayList<JCheckBox> inprogress_box = new ArrayList<JCheckBox>();
and when the user clicks on the button I have this,
for(JCheckBox cb : todo_box)
{
if(cb.isSelected() )
{
inprogress_box.add(cb);
jPanel2.add(cb);
jPanel2.revalidate();
cb.setVisible(false);
todo_box.remove(cb);
jPanel1.remove(cb);
jPanel1.revalidate();
}
}
Not sure if I'm on the right track since I'm getting an exception error inside netbean.