示例#1
0
  /**
   * Returns the object[] of a row.
   *
   * @param selectedRow the row to retrieve.
   * @return the object[] of a row.
   */
  public Object[] getRowObject(int selectedRow) {
    if (selectedRow < 0) {
      return null;
    }

    int columnCount = getColumnCount();

    Object[] obj = new Object[columnCount];
    for (int j = 0; j < columnCount; j++) {
      obj[j] = tableModel.getValueAt(selectedRow, j);
    }

    return obj;
  }
示例#2
0
 /**
  * Adds a list to the table model.
  *
  * @param list the list to add to the model.
  */
 public void add(List list) {
   for (Object aList : list) {
     Object[] newRow = (Object[]) aList;
     tableModel.addRow(newRow);
   }
 }