i made a jtable , and everthing is working fine so fare , but still i got a problem in sorting the values of the table . some of my code:
int nalt = (int) (1 + ((altmax - altmin) / incr));
tabela = new JTable(new Object[nalt][6], colunas);
for (int i = 0; i <= (nalt - 1); i = i) {
for (double j = altmin; j <= altmax; j = j + incr) {
Double tati = new Double(j);
tabela.setValueAt(tati, i, 0);
i = i + 1;
}
}
tabela.setPreferredScrollableViewportSize(tabela.getPreferredSize());
tabela.setFillsViewportHeight(true);
tabela.setAutoCreateRowSorter(true);
JScrollPane jps = new JScrollPane(tabela);
panel2.add(jps);
the problem is , when i try to sort the columns from the higher to smaller number i'm getting something like this :
950
9000
850
80000
7500
7
6000
if you could help me i would appreciate it
thanks