sclass TextChangingListCellRenderer extends DefaultListCellRenderer { O f; // func(S) -> S *(O *f) {} public Component getListCellRendererComponent(JList list, O value, int index, bool isSelected, bool cellHasFocus) { Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); S s = strOrEmpty(value); setText(f == null ? value : str(callF(f, s))); ret c; } }