static DefaultListCellRenderer customToStringListCellRenderer(IF1 toString) { ret new DefaultTreeCellRenderer { @Override public Component getListCellRendererComponent(JList list, O value, int index, bool isSelected, bool cellHasFocus) { Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); setText(toString.get((A) value)); ret c; }; }