Geertjan's Blog

  • January 25, 2011

Quick Search Popup

Geertjan Wielenga
Product Manager
The quick search popup appears when you start typing in a treeview, e.g., in BeanTreeView:

By default, the search is by prefix, e.g., above, "D" is typed and immediately "Dick" is selected, since that string starts with "D". However, you can use this statement:


...and then the entered text is used as a substring in the search:

Above, the "r" wouldn't have matched anything by default, since there's no string that starts with that letter. However, in the substring search, it matches "Harry", since there's an "r" in that string.

After the first matching node has been found, press F3 to jump to the next matching node and Shift-F3 to jump to the previous matching node.

Finally, you can also disable the quick search popup completely, which means that the JPanel will not appear at all when you type in the tree view:


Related issues:

Join the discussion

Comments ( 3 )
  • ilhami visne Wednesday, January 26, 2011

    It is a very nice built-in feature. However, in case of hundrends of nodes, i would like to filter it to get an overview instead of jumping to higlighting the nodes. If the user write "r", the user sees the nodes containing "r".

    Has BeanTreeView built-in filtering feature similar to quicksearch?


  • Martin Dvoracek Monday, August 1, 2011

    Really nice :) Do you think it would be possible to share the code?

  • Carlos Delgado Wednesday, May 23, 2012

    Very good post, thanks.

    I have a question about the quicksearch: is it possible to make it always visible and at the top of the component, instead of at the bottom?

    In other words, is it possible to customize it? How?



Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.