ComboBox Editable as Input field

Answered

Hi 

I would like to implement an editable  combobox of Strings  ( with ~100+ items )  that behave in a way that when user to start its type,  the items shown will be only those that match its input. 

Same as Input field but with the option of clicking on the combobox and see all items at first. 

 

I search for an example of such a combobox but could not find any. Is this possible ? If so is there any example I can get inspiration  from ? 

Thanks 
Jonathan 

6 comments
Comment actions Permalink

Hello Hgafner!

 

I don't know if I understood you correctly - you're looking for the existing UI component that will be a ComboBox with a filterable items list.

Something like that?

0
Comment actions Permalink

Yes exactly

0
Comment actions Permalink

This kind of ComboBox is an implementation of ComboBoxAction.

0
Comment actions Permalink

Thanks Jakub.

I need this as component in my Dialog, is there any component ready for that or I should check the implementation of the ComboAction and do like ? 

 

Thanks again

0
Comment actions Permalink

In this case, I'd advise you to review some existing implementation in the IntelliJ SDK repository like 

com.intellij.ui.popup.list.ComboBoxPopup

https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/ui/popup/list/ComboBoxPopup.java

0
Comment actions Permalink

Thanks Jakub Chrzanowski 

I took a look and it is quite complicate since the class there is not a component and since it is not part of the open api I am getting some strange issue when trying to implementing it by myself. 

 

I also implement a combobox as show in here:
https://www.logicbig.com/tutorials/java-swing/combo-box-filter.html

but I am getting a huge UI delay :(. 

Hope one day there will be an easy way to do it. 

Thanks 

0

Please sign in to leave a comment.