Skip to content

Commit f3ec29b

Browse files
committed
Fix final capture for popup button action listener
1 parent 21591fe commit f3ec29b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

CodenameOne/src/com/codename1/ui/spinner/Picker.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,13 @@ private Container createLightweightPopupButtonRow(final InternalPickerWidget spi
763763
row.setUIID(isTablet ? "PickerButtonBarTablet" : "PickerButtonBar");
764764
$(row).selectAllStyles().setMargin(0).setPadding(0).setBorder(Border.createEmpty()).setBgTransparency(0);
765765
}
766-
Button button = new Button(entry.text, isTablet ? "PickerButtonTablet" : "PickerButton");
766+
final LightweightPopupButton popupButton = entry;
767+
Button button = new Button(popupButton.text, isTablet ? "PickerButtonTablet" : "PickerButton");
767768
button.addActionListener(new ActionListener() {
768769
@Override
769770
public void actionPerformed(ActionEvent evt) {
770-
if (entry.action != null) {
771-
entry.action.run();
771+
if (popupButton.action != null) {
772+
popupButton.action.run();
772773
}
773774
spinner.setValue(value);
774775
updateValue();

0 commit comments

Comments
 (0)