A variety of constructors exist for JTable:
public JTable() -- creates an instance of the JTable class that is initialized with a default data model, column model, and selection model.
public JTable(TableModel dm) -- creates an instance of the JTable class that is initialized with a default column model and selection model, and with the specified data model.
public JTable(TableModel dm, TableColumnModel cm) -- creates an instance of the JTable class that is initialized with a default selection model. The data model and column models specified are assigned to the instance.
public JTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm) -- creates an instance of the JTable class that is initialized with the specified selection model, data model, and column model.
public JTable(int numColumns, int numRows) -- creates an instance of the JTable class that is initialized with a default data model, column model, and selection model. The data model contains an array of empty cells specified by the number of rows and column from the caller. By default, the column names will have the form A, B, C, and so on.
public JTable(Vector data, Vector columnNames) -- creates an instance of the JTable class that is initialized with a default data model, column model, and selection model. The data model receives the data from the first vector parameter. The second vector is transferred to the default column model.
public JTable(Object data[][], Object columnNames[]) -- creates an instance of the JTable class that is initialized with a default data model, column model, and selection model. The data model receives the data from the first object array parameter. The second array is transferred to the default column model.