scroll/search JList when user starts typing
I would like to allow a user to click on a JList and if words are typed, do a query and advance the caret to the next match (prefix). Is there and example of such an implementation in Java somewhere? 开发者_如何学JAVAI'm thinking a combination of key listeners, getNextMatch()
and setSelectValue()
.
JXList of Swinglabs has the exact same thing you are looking for
Try :
https://swinglabs-demos.dev.java.net/
I suggest you take a look at glazed lists, or other implementations of completion in java/Swing.
精彩评论