问题描述
谁能帮助我这个问题,我有一个JTable,我想搜索具有的JTextField其中的数据,作为用户的类型,建议出现在下拉列表,从中选择,那么用户选择它,结果显示在表中。
can anyone help me with this , I have a jtable and I want to search for the data in it with jtextfield , as the user types, suggestions appears in a drop down list and select from it , then the user select it and the results appears in the table.
推荐答案
这是可能的两种方式。
1),最简单的不实施自动完成的JTextField
,
- 已经实施的 code例如
1) easiest without implement for autocomplete JTextField
, - JTable has implemented Sorting and Filtering code example in the tutorial
2)实施(读整个线程,因为有一个在SwingX实现最另类外观极好)和
2) by implement AutoComplete JComboBox / JTextField (read whole thread because there is most excelent alternative implemented in the SwingX) and for JTable to set Filtering
这篇关于自动完成搜索JTextField中的Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!