*/
public void poll() {
target.poll();
Event event = new Event();
EventQueue queue = target.getEventQueue();
while (queue.getNextEvent(event)) {
// handle button event
if (buttons.contains(event.getComponent())) {
Component button = event.getComponent();
int buttonIndex = buttons.indexOf(button);
buttonState[buttonIndex] = event.getValue() != 0;