我现在正在研究 JTables 并有一堆业务对象,我使用 Hibernate + Spring Data JPA 从数据库中检索这些对象.
我喜欢 Spring Data JPA 处理 DAL 的所有繁琐实现,并且想知道是否有类似的东西用于 TableModel
.
基本上,我会有一些类似的东西:
public class GenericTableModel<T> extends AbstractTableModel
还有 GenericTableModel
会使用反射和/或注释来查看 T
.
这样的东西存在吗?我希望我不必为要在 JTable 上显示的每个对象都设置一个 TableModel。
最佳答案
And the GenericTableModel would use reflection to look into T.
Bean Table Model这样做。
关于java - 是否有可以在 JTables 中使用的通用 TableModel?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9153945/