I have a table in which the first column contains rows and the second contains doubles.
stars = new StarDatabase(path);
Object[][] data = new Object[stars.size()][2];
int i = 0;
for (String name : stars.keySet()) {
data[i][0] = name;
data[i++][1] = stars.get(name).period;
}
StarsTable = new JTable(data, StarsColumnNames);
StarsTable.setAutoCreateRowSorter(true);
Double elements are sorted as strings, so 1 <15 <2 <25 <3. How can I fix this?
source
share