Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Autocomplete JComboBox with image  RSS feed

 
anchit pancholi
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am using JComboBox which have product name product image, to make it autocomplete i used below listener but name and image in drop down is not getting highlight :-


Please let me know if code is not complete to understand.

looks CaretPosition is not getting set properly due to image in JCombobox. Any idea how can i set Caret Position to correct index?

Thanks
Anchit
 
m Korbel
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- no idea how Icon/ImageIcon(s) is/are ... , because there are three-four (correct) ways, leaving any guessing, comments

- I would not recommend to use KeyListener, KeyEvent for this job, nor for JTextComponents (derived Editor from JComboBox) every those event are manageable in DocumentListener, DocumentFilter

- start with AutoComplete JComboBox/JTextField or decorator/highlighter by SwingX

- with standard rendering as is described in Oracle tutorial aboout How to use ComboBoxes
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!