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?
-
2Please research your topic before asking a question; there are many tutorials out there which can be found with a simple Google search.Dennis– Dennis2012-01-06 04:18:43 +00:00Commented Jan 6, 2012 at 4:18
-
duplicated at stackoverflow.com/questions/8774481/filling-object-data/8774505 and stackoverflow.com/questions/8775076/jtablejdbc-easiest-wayalf– alf2012-01-08 11:05:46 +00:00Commented Jan 8, 2012 at 11:05
Add a comment
|
3 Answers
Seems your question is similar with these two questions:
Comments
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.