1const table = $("#yourTable").DataTable();
2
3table.row.add( /* array or object */).draw();
4
5// or using tr
6const tr = $("<tr><td>1</td><td>2</td></tr>");
7table.row.add(tr[0]).draw();
8
9// you must call draw() to see your changes
1private void jButton1ActionPerformed(java.awt.event.ActionEvent) {
2 String data1 = something1.getSomething();
3 String data2 = something2.getSomething();
4 String data3 = something3.getSomething();
5 String data4 = something4.getSomething();
6
7 Object[] row = { data1, data2, data3, data4 };
8
9 DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
10
11 model.addRow(row);
12
13 // clear the entries.
14}