0

hello!

i want to create jtable dynamically...

i have two class one is add records to Data Base another one is show
records list that were inserted...

how do pass each records in JTable without replacing existing on...

i need to grow the table every time the records success fully inserted...

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by javaAddict
0

Use the method of JTable: setModel(TableModel dataModel).
Create a DefaultTableModel object and pass that as parameter to the setModel method.

Whenever you want to insert a new row, just call the method addRow of your DefaultTableModel instance. You don't need to call the setModel again as long you are calling the addRow method of the same instance as the one used to create the JTable

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.