更新时间:2023-12-03 11:52:52
你需要both一个渲染器和和编辑器,如下图所示示例.请参阅如何使用表:编辑器和渲染器,了解详情.切线地,您应该覆盖 TableModel
中的方法 isCellEditable()
而不是扩展 JTable
.
You need both a renderer and and editor, as shown in this example. See How to Use Tables: Editors and Renderers for details. Tangentially, you should override the method isCellEditable()
in your TableModel
rather than extending JTable
.