How to assign the auto complete text field to JTable cell?

后端 未结 2 1340
没有蜡笔的小新
没有蜡笔的小新 2021-01-27 11:16

I have created one Class for auto complete text fields.

I want to use that Class and try to include my JTable cell fields, but it

相关标签:
2条回答
  • 2021-01-27 12:05
    • you can to use AutoComplete JComboBox / JTextField

    • put this JComboBox / JTextField to the JTable as Renderer and Editor

    0 讨论(0)
  • 2021-01-27 12:06

    (Assuming I understand the question)

    You need to wrap your editor in TableCellEditor. Have a look at Using Other Editors an example.

    Once you have it set up, you need to register the editor with the table.

    One way is to register the editor with the column in question via the TableColumnModel

    table.getColumnModel().getColumn(indexToColumnInQuestion).setCellEditor(tableCellAutoCompleteEditor);
    
    0 讨论(0)
提交回复
热议问题