如何清除扩展 AbstractTableModel 的自定义 TableModel
正是问题所指出的。我创建了一个自定义 tableModel
类,我想在 actionPerformed
上清除与该模型关联的 JTable
。
Exactly what the question states. I created a custom tableModel
class and I want to clear the JTable
associated with that model on an actionPerformed
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须从用于表的 TableModel 中删除数据。
如果使用 DefaultTableModel,只需将行计数设置为零。这将删除行并触发 TableModelEvent 来更新 GUI。
如果使用其他 TableModel 请查看文档。
You must remove the data from the TableModel used for the table.
If using the DefaultTableModel, just set the row count to zero. This will delete the rows and fire the TableModelEvent to update the GUI.
If using other TableModel please check the documentation.