const table = $("#yourTable").DataTable();
table.row.add( /* array or object */).draw();
// or using tr
const tr = $("<tr><td>1</td><td>2</td></tr>");
table.row.add(tr[0]).draw();
// you must call draw() to see your changes
private void jButton1ActionPerformed(java.awt.event.ActionEvent) {
String data1 = something1.getSomething();
String data2 = something2.getSomething();
String data3 = something3.getSomething();
String data4 = something4.getSomething();
Object[] row = { data1, data2, data3, data4 };
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
model.addRow(row);
// clear the entries.
}
const t = $('#myTable').DataTable();
t.row.add( [ ... ] ).node().id = 'myId';
t.draw( false );