Auto complete textbox in Java Swing

后端 未结 5 647
青春惊慌失措
青春惊慌失措 2021-01-03 02:54

Is there any good ready made Java Swing component that can be used to implement auto complete textbox?

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 03:33

    Here's an example on autocompletion without a drop down selection. It will only autocomplete for you when a unique match is found. The completion is auto inserted into the text field and selected. Kind of similar as to how Safari's address field works.

    The solution could be expanded to provide a list of options, however that was not part of my requirements when doing this.

    UPDATE

    I lost the domain with the original code. It can now be accessed on github: https://github.com/sasjo/autocomplete

提交回复
热议问题