0
I am creating a Java system using Netbeans. I would like to create a search box that shows the results in a list (of variable size) below the box as the user enters the text to be searched. It would be something similar to the Google search box, which shows suggestions while the user is typing.
The system should also allow the user to select search results, without the other results being hidden. I would like the list of results to be on other components of the interface.
I would also like it to be possible to search from certain cells in a table and the results to be displayed below the cell used for searching.
I don’t know any class components Swing
or Netbeans functionality that can do this. Someone has some idea?
Try to use the
JComboBox
.– Victor Stafusa
I think it’s not quite what I wanted. I would like to see only the results and not all the options, as in this component. In addition, it seems that this component performs the search only at the beginning of the sentence and I would like to see results that also have the expression searched in the middle of the sentence. My idea is that the search was done in the Mysql database and that the results were returned as the user goes typing.
– Marcelo Henrique Bittencourt
To perform a search as the user type, you can use Jcombobox as the friend @Victor Stafusa said, add a change event in the component and perform a search in the database with those that have already updated their grid for each change event that was held.
– Edvaldo Farias