Skip to main content

Creating non-strict autocomplete JComboBox

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
ntraykov
Offline
Joined: 2011-01-21

Hi, could you please tell me how to create a non-strict autocomplete JComboBox, because I've seen swingxset.jnlp (SwingLabs demos), and there the source code for strict, and non-strict autocomplete is the same?

Cheers
nIKO

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miguelm
Offline
Joined: 2005-03-17

nIKO,
String vs. non-strict in a JComboBox is determined by the JComboBox API, not by AutoComplete. You make the JComboBox non-strict by setting editable to true. Do this before calling AutoCompleteDecorator.decorate().