I have a class View
with a JTable and another class DB
.
In DB
is a method with a database connection.
When calling this method from
The easiest way is to put your data in vectors, and then construct a Vector from the data, and then construct a DefaultTableModel with that data.
If all you need to do is view the data this is the easiest way. Its not really a good way for viewing the data though, and its really quite bad when it comes to editing.
The return type should be whatever you want your TableModel to support.
See Table From Database for some ideas.