79591544

Date: 2025-04-24 22:38:06
Score: 1
Natty:
Report link

Here is a simple ItemEventListener that can give you the previous selected item.

For me the item is a String so I cast to it.

ItemEventListener listener = e -> {
    if (e.getStateChange() == ItemEvent.DESELECTED) {
        previousItem = (String) e.getItem();
    }
};
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: user30366026