A problem arises when I get the value of the cells of a specific column and it is that I want to obtain the order of those data, use:
TableRowSorter sorter = new TableRowSorter(ModeloClientes);
tablaCliente.setRowSorter(sorter);
that is the order in which he shows them to me if I click on the column, previously with the sql I give order of asc to the amount. But I also need the order in which the table updates it. I used this code but it still grabs me in the same order of sql.
private void tablaClienteMouseClicked(java.awt.event.MouseEvent evt) {
DefaultTableModel ModeloClientes = (DefaultTableModel) tablaCliente.getModel();
if (evt.getClickCount() == 1)
{
for (int i = 0; i < tablaCliente.getRowCount(); i++)
{
Object f = tablaCliente.getModel().getValueAt(i, 1);
String d = f.toString();
int numero = Integer.parseInt(d);
ORDENALEATORIO[j]=numero;
j++;
}
}
}