How do I show a tooltip for a JComboBox item?

Sandip Chitale

For the item that is normally shown in the JComboBox simply calling the -

ToolTipManager. sharedInstance().registerComponent(comboBox);
comboBox.setToolTipText("item info");

should work.

For the items in the popup associated with the JComboBox you will have to install a custom ListCellRenderer using the following class and API -

class MyCellRenderer extends JLabel implements ListCellRenderer {
     public MyCellRenderer() {
     public Component getListCellRendererComponent(
         JList list,
         Object value,
         int index,
         boolean isSelected,
         boolean cellHasFocus)
         // should be done only once...
         ToolTipManager. sharedInstance().registerComponent(list);
         setBackground(isSelected ? Color.red : Color.white);
         setForeground(isSelected ? Color.white : Color.black);
         if (value != null) {
             setToolTipText("item info based on the value");
         return this;
comboBox.setRenderer(new MyCellRenderer());