Using the sample code on the blackberry api dev site
here.[
^]
FieldChangeListener listener = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
ButtonField buttonField = (ButtonField) field;
System.out.println("Button pressed: " + buttonField.getLabel());
}
};
for (int x=0; x< 10; x++)
{
ButtonField buttonField = new ButtonField("Test Button" + x);
buttonField.setChangeListener(listener);
}
I have never developed on Blackberry, so can't say for sure it 100% correct, but it will give you a starter.