Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Add data or add row in JTable java

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.
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Add #data #add #row #JTable #java
ADD COMMENT
Topic
Name
2+5 =