I have a process:
get widths of column table
refresh
set widths of column table
Here are my methods
This gets the column width table
public ArrayList<Integer> getJTableColumnsWidth() {
ArrayList<Integer> list = new ArrayList<>();
for (int i = 0; i < tableR.getColumnModel().getColumnCount(); i++)
{
TableColumn column = tableR.getColumnModel().getColumn(i);
System.out.print(column.getPreferredWidth());
list.add(column.getPreferredWidth());
}
return list;
}
There are 18 columns in my table.
I then want to pass each number of my arraylist into a method like below..
setTableWidths(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18)
where each number is just each number in the arraylist and contains a width.
I can call each number of the arraylist by calling
getJTableColumnsWidth()
but then how is this passed directly to setTableWidths(x1,x2,x3,x4,x5....)
?