- You haven’t assigned a Button instance to buttons[] at index b1 yet.
- You have for b2 though:
buttons[b2] = new Button( "All", start, 100, color(255));
- And all indices < nt:
buttons[i] = new Button(names[i], start-100, y, trucks[i].c);
1 Like