Remove item in JCombobox drop down list on clicking Icon next to it

I want to create a jcombobox in which an icon displayed next to each of the listed item within the JComboBox drop-down list – clicking on which will remove that item.
Example as Image

Answer

JComboBox (and many other Swing components) rely on renderers to provide custom rendering of the values they display. This makes it easy to provide multiple different views of the same data.

Start by taking a read through How to Use Combo Boxes

Pay attention to the section on Providing a Custom Renderer

Leave a Reply

Your email address will not be published. Required fields are marked *