• Post Reply Bookmark Topic Watch Topic
  • New Topic

How delete the specify item on the JComboBox immediately.

 
xfilson filson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make a JComboBox like that the item has a text and label (the label with a delete icon) , and if I press the label ,the corresponded item is invisible ,and the dropdown menu is still visible.

How I can do it ?

I have write a render like it:

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by
and if I press the label ,the corresponded item is invisible ,and the dropdown menu is still visible.


Any combo box in a GUI, when clicked on, will dropdown with list of elements. And when you 'select' an element, events will occur(Action, ItemStateChanged etc.).
Even if you write an ActionListener for the label within the renderer, I don't think it will work...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!