List of utility methods to do JTable Row Add
void | addNewRow(int index, JTable table, DefaultTableModel tableModel) add New Row String[] row = new String[table.getColumnCount()]; for (int cnt = 0; cnt < table.getColumnCount(); ++cnt) { row[cnt] = "Heading" + cnt; tableModel.insertRow(index, row); |
void | addRow(JTable table, Object... data) add Row ((DefaultTableModel) table.getModel()).addRow(data); |
DefaultTableModel | addRowsToTable(Vector rows, int colCount) add Rows To Table int rowCount = rows.size(); DefaultTableModel tableModel = new DefaultTableModel(); tableModel.setColumnCount(colCount); for (int cnt = 0; cnt < rowCount; ++cnt) { String[] rowData = (String[]) rows.get(cnt); tableModel.addRow(rowData); return (tableModel); ... |
void | addRowToJTable(final JTable table, final Object[] data) Add new row to table DefaultTableModel tableModel = (DefaultTableModel) table.getModel(); tableModel.addRow(data); |
void | addRowToTable(JTable table) add Row To Table Object[] o = new Object[table.getModel().getColumnCount()]; for (int idx = 0; idx < o.length; idx++) { o[idx] = null; DefaultTableModel m = (DefaultTableModel) table.getModel(); m.addRow(o); |
void | appendRow(JTable table, Object[] row) append Row ((DefaultTableModel) table.getModel()).addRow(row); |