Sort a multidimensional int array based on another string in java

I have tried many things and this seems to work, but it works only for the first line and i’m not sure why.

keyword = “CORTINA”;
Based on previous code i have encryptedArray contains the following:
1 1 0 0 3 4 0
4 3 3 1 2 1 3
2 1 2 1 2 2 0
0 2 3 0 2 0 4
2 3 3 4 0 4 3
2

My program outputs the following from previous code:

C O R T I N A
1 1 0 0 3 4 0
4 3 3 1 2 1 3
2 1 2 1 2 2 0
0 2 3 0 2 0 4
2 3 3 4 0 4 3
2

And i tried with this sorting algorithm to sort the int array based on the alphabetical order of the keyword.

private void doSorting(String keyword, int[][] encryptedArray) {

    char[] charKeyword = keyword.toCharArray();

    int rows = keyword.length();
    int cols = encryptedArray[0].length;

    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            for (int k = 0; k < rows - j - 1; k++) {
                if (charKeyword[k] > charKeyword[k + 1]) {
                    char tempChar = charKeyword[k];

                    charKeyword[k] = charKeyword[k + 1];
                    charKeyword[k + 1] = tempChar;


                    int tempNum = encryptedArray[i][k];

                    encryptedArray[i][k] = encryptedArray[i][k + 1];
                    encryptedArray[i][k + 1] = tempNum;

                }
            }
        }
    }


    for (int i = 0; i < charKeyword.length; i++) {
        System.out.print(charKeyword[i] + " ");
    }

    System.out.println();
    for (int i = 0; i < encryptedArray.length; i++) {
        for (int j = 0; j < encryptedArray[i].length; j++) {
            System.out.print(encryptedArray[i][j] + " ");
        }
        System.out.println();
    }
    
}

And the overall program outputs as follows:

C O R T I N A
1 1 0 0 3 4 0
4 3 3 1 2 1 3
2 1 2 1 2 2 0
0 2 3 0 2 0 4
2 3 3 4 0 4 3
2

A C I N O R T
0 1 3 4 1 0 0
4 3 3 1 2 1 3
2 1 2 1 2 2 0
0 2 3 0 2 0 4
2 3 3 4 0 4 3
2

Instead what i want is to output:

C O R T I N A
1 1 0 0 3 4 0
4 3 3 1 2 1 3
2 1 2 1 2 2 0
0 2 3 0 2 0 4
2 3 3 4 0 4 3
2

A C I N O R T
0 1 3 4 1 0 0
3 4 2 1 3 3 1
0 2 2 2 1 2 1
4 0 2 0 2 3 0
3 2 0 4 3 3 4
2

What i wrote here might be a lot but i didn’t knew how to describe it in other way.