private void pageDown() {
        TextGrid.DataGridCel cel;
        if (rowOffset + numberOfRows > grid.getNumRows()) {
            currentRow = grid.getNumRows() - rowOffset;
        } else {
            if (grid.getNumRows() < numberOfRows) {
                rowOffset = 0;
                currentRow = grid.getNumRows() - 1;
            } else {
                if ((rowOffset + numberOfRows) >= grid.getNumRows()) {
                    rowOffset = grid.getNumRows() - numberOfRows;
                    currentRow = numberOfRows - 1;
                } else {
                    rowOffset = rowOffset + numberOfRows;
                }
            }
        }

        cel = grid.getCel(currentRow + rowOffset, currentCol + colOffset);
        while (cel == null) {
            currentRow--;
            cel = grid.getCel(currentRow + rowOffset, currentCol + colOffset);
        }

        if (cel.getCharacter() == DataGridCel.NullChar) {
            end();
        }
    }