After a good night sleep I was filled with creativity... blablabla
The solution: First make a new matrix that is copy of the matrix in the parameter and a matrix that will be the correct output.
The point is to alter the old matrix if you find a element that has to be filtered.. if you find a illegal element you take a element below you and move all elements below you (in that column) 1 spot up. The last row will contain garbage but that is not a problem if you just ignore that information. The problem with my original code was that I did not move all elements below a filtered element up one spot.. only at the first occurrence of a illegal element.
String[][] filterMatrix (char charTobeFiltered, String[][] oldMatrix)
{
String[][] oldMatrixCopy = new String[oldMatrix.length][oldMatrix[0].length];
oldMatrixCopy = oldMatrix;
String[][] newMatrix = new String[oldMatrix.length - 1][oldMatrix[0].length];
for (int i = 0; i < newMatrix.length; i++)
{
for (int j = 0; j < newMatrix[0].length; j++)
{
if (oldMatrixCopy[i][j].charAt(0) == charTobeFiltered)
{
for (int k =i; k < newMatrix.length; k++)
{
oldMatrixCopy[k][j] = oldMatrixCopy[k+1][j];
}
}
newMatrix[i][j] = oldMatrixCopy[i][j];
}
}
return newMatrix;
}
frustrating but oh so liberating when it finally succeeds.. thx and hope somebody can find some use in this.