I have 4 checkboxes, when selected they should concatenate onto a single string displayed on a Jlabel. It was working before sort-of, not sure whatI did to break it, now I get array exception out of bounds errors. This is the update() method being run whenever a checkbox is interacted with.
http://pastebin.com/tbSpx7jA
It's been answered thanks all, just messed up my initial array declaration.
It looks like you're iterating to an index that does not exist:
for (int j = 0; j <= oslist2.length; j++)
should be
for (int j = 0; j < oslist2.length; j++)
Java array indexes are (0, 1, 2... length-1)
You also have
oslist2[3]="";
which means, you should make the array bigger, or don't use that index. This should work:
String[] oslist2 = new String[4];