问题描述
我知道如何从Java中的数据库中检索数据(仅在表中的文本)以及如何在控制台中显示它.但是我想将其加载到JTable中. 没有使用向量的情况下有很好的(现代)方式(教程)?
推荐答案
查看本教程:如何使用桌子
其他推荐答案
似乎您的问题与这两个问题相似:
如何用数据库中的JTable填充数据?<<<<<<<<<<<<<
中显示数据其他推荐答案
查看GlazedLists,它带有基于现代收集界面的现成的tablemodels.
如果您不想使用额外的库.您可以轻松地实现自己的 javax.swing .table.tablemodel .我喜欢实现tablemodel和java.util.list,所以我只使用一个简单的列表,并可以轻松地勾勒出任何列表.
问题描述
I know how to retrieve data (just text in a table) from a database in Java and how to show it in the console. But I want to load it in a JTable. Is there a good (modern) way (tutorial), without using Vectors?
推荐答案
Check out this tutorial: How to Use Tables
其他推荐答案
Seems your question is similar with these two questions:
How to fill data in a JTable with database?
Displaying data from database in JTable
其他推荐答案
Check out GlazedLists it comes with ready made TableModels that are based on modern collection interfaces.
If you don't want to use an extra library. You can easily implement your own javax.swing.table.TableModel. I like to implement TableModel and java.util.List so I'm working with just a simple List, and hooking up any List easily.