JTable getting values of specific column
java, jtable, swing
Solution
you can do something like this
ArrayList list = new ArrayList();
for(int i = 0;i<table.getModel().getRowCount();i++)
{
list.add(table.getModel().getValueAt(i,0)); //get the all row values at column index 0
}
Problem
How could I get the values under specific column in JTable example : ``` _________________________ | Column 1 | Column 2 | ________________________ | 1 | a | ________________________ | 2 | b | ________________________ | 3 | c | _________________________ ``` How could I get the values under Column 1 that is [1, 2, 3] In the form of some data structure ( preferable array)?