/**
* Creates a button panel using the given buttons, and register the given listener for button actions.
* Buttons are disposed horizontally, aligned to the right.
*/
public static JPanel createButtonPanel(JButton buttons[], JRootPane rootPane, ActionListener actionListener) {
JPanel panel = new ButtonChoicePanel(buttons, 0, rootPane);
MnemonicHelper mnemonicHelper = new MnemonicHelper();
for (JButton button : buttons) {
button.setMnemonic(mnemonicHelper.getMnemonic(button.getText()));
button.addActionListener(actionListener);
panel.add(button);
}
return panel;
}