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?
查看本教程: 如何使用表
Seems your question is similar with these two questions:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.