From Java Academy II:Intermediate Java NPAC/ECS Java Academy -- February to April 98. byTom Scavo
A for-loop processes each checkbox: int n = box.length; for ( int i = 0; i < n; i++ ) { box[i].setForeground(...); box[i].setBackground(...); add( box[i] ); box[i].addItemListener( this ); }