I have a JTable, and i want to sort rows sometimes by integer (size column), sometimes by String (file path). So i searched it on google and i\'ve arrived here. i\'ve known
Jimmy, as mKorbel as pointed out, you data model consists of Strings. Sorting numbers as String will not sort in natural order (10 will fall before 1).
You need to first change you model from
Personal_model(String[][] s,String[] i){
to
Personal_model(Object[][] s,String[] i){
You then need to make sure that the data you're putting in the model is correct. We don't have that section of code, but don't use String to represent the numbers in the Object[][]
ie
Object[][] myData = new Object[1][2];
myData[0][0] = "This is a String value";
myData[0][1] = 1; // This is not a String value
All credit to mKorbel please