I have an Editable JComboBox
search field in one of my Java swing application. I wanted to save space of the search box header and put in search icon inside the editable jcombobox
to depict it as a search field. Which should look quite similar to a Facebook search field.
So, my question is that, Is there any way to achieve such a thing in Java
? As a beginner my idea is void about this. Any suggestion / help would positively work for me.
Thanks
You can use a custom Border on the editor of the combo box which is a text field:
The MatteBorder will tile the image in the Border, so you need to make sure the image is the size of the text field, or you create a custom Border that only paints the image once.
Read the section from the Swing tutorial on How to Use Borders for more information.