if (commands.size() == 1) {
execute((Command) commands.get(0));
return;
}
KPanel btnPanel = new KPanel();
GridLayout layout = new GridLayout(commands.size(), 1);
layout.setVgap(2);
btnPanel.setLayout(layout);
for (int i = 0; i < commands.size(); i++) {
Command command = (Command) commands.get(i);
final KButton btn = new KButton(command.getDescription());
btn.setFont(new Font(btn.getFont().getName(), Font.BOLD, btn.getFont().getSize() + 6));
command.setExecuter(this);
btn.addKeyListener(command);
// flash button
btn.addKeyListener(new KeyListener() {
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
btn.setBackground(Color.BLACK);
btn.repaint();
}
public void keyReleased(KeyEvent e) {
btn.setBackground(Color.WHITE);
btn.repaint();
}
});
btnPanel.add(btn);
}
rootContainer.add(btnPanel, BorderLayout.NORTH);
} catch (Throwable t) {