Here you can find the source of AddToTable(JTable tbl, Object[] obj, boolean head)
public static void AddToTable(JTable tbl, Object[] obj, boolean head)
//package com.java2s; /**/* w ww .jav a2 s.c o m*/ * CEDP: Computer Evaluator for Dependability and Performance * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. */ import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class Main { public static void AddToTable(JTable tbl, Object[] obj, boolean head) { int size = tbl.getRowCount(); DefaultTableModel tableModel = (DefaultTableModel) tbl.getModel(); if (head) { tableModel.insertRow(0, obj); } else { tableModel.insertRow(size, obj); } } }