JTable+JDBC: Easiest way

后端 未结 2 755
天涯浪人
天涯浪人 2020-12-12 07:08

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

相关标签:
2条回答
  • 2020-12-12 07:25

    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.

    0 讨论(0)
  • 2020-12-12 07:26

    The return type should be whatever you want your TableModel to support.

    See Table From Database for some ideas.

    0 讨论(0)
提交回复
热议问题