Component (JList<? extends T> list, T value, int index, boolean selected, boolean hasFocus) { mySeparator = false; myIcon = null; myText = null; myForeground = null; myBackground = null; myFont = null; myToolTipText = null; myProperties = FList.emptyList(); customize(list, value, index, selected, hasFocus); if (mySeparator) { return createSeparator(myText); } Component component = myRenderer != null ? myRenderer.getListCellRendererComponent(list, value, index, selected, hasFocus) : new JBLabel(); if (component instanceof JLabel label) { label.setIcon(myIcon); if (myText != null) label.setText(myText); if (myForeground != null) label.setForeground(myForeground); if (myBackground != null && !selected) label.setBackground(myBackground); if (myFont != null) label.setFont(myFont); label.setToolTipText(myToolTipText); for (Pair<Object, Object> pair : myProperties) { label.putClientProperty(pair.first, pair.second); } } return component; }