本文介绍了如何分配自动完成文本字段的JTable细胞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已创建了一个类自动完成文本字段。
我想使用类和尝试,包括我的的JTable 电池领域,但它不会显示
请指教
解决方案(假设我理解这个问题)
您需要换你编辑器的TableCellEditor 。看看一个例子rel=\"nofollow\">。
一旦你有它设置,您需要注册与表编辑器。
的一种方式是通过 TableColumnModel的
table.getColumnModel().getColumn(indexToColumnInQuestion).setCellEditor(tableCellAutoCompleteEditor);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 won't display.
Please advice
解决方案(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);
更多推荐
如何分配自动完成文本字段的JTable细胞?
发布评论