svoid comboBoxDynamicToolTip(JComboBox cb, IF1 makeToolTip) {
class ComboBoxRendererWithToolTip extends javax.swing.plaf.basic.BasicComboBoxRenderer is javax.swing.plaf.UIResource {
public Component getListCellRendererComponent(JList list, O value, int index, bool isSelected, bool cellHasFocus) {
var c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
//printVars(+isSelected, +value, +index);
if (c cast JComponent && isSelected) pcall {
c.setToolTipText(makeToolTip?.get((A) value));
}
ret c;
}
}
cb.setRenderer(new ComboBoxRendererWithToolTip);
}