Java 2d array nested loops
I think the nicest thing to do is to create a function which separates the counting of the elements of an array from the array itself.  For example, right now you have a "counting procedure", which basically looks like this:

public static boolean count(int[] values) {

   int count = 0;
   int currentElement = values[0];
   for(int i = 0; i &lt; values.length; i++) {
     if (currentElement == values[i])
       count++;
     currentElement = values[i];
   }
   return (count &gt;= 4);
}


Once you've separated this out, counting the rows is as simple as

int rows = values.length
int cols = values[0].length
for (int i = 0;i &lt; rows; i++)
  if (count(values[i]))
    return true;


Counting the columns like this is a little trickier.  I think the cleanest way to do this is to actually allocate a temporary array and fill it with the correct values.  Note that this isn't faster than what you've recommended -- it's only prettier.

int[] tmpArray = new int[rows];
for (int j = 0; j &lt; cols; i++) {
  for (int i = 0; i &lt; rows; i++)
    tmpArray[i] = values[i][j];
  if (count(tmpArray))
    return true;
}


It's not actually clear to me at all if your diagonal counting code works, but now we have a nice tool to write it intuitively.  What's tricky is I cannot see the four distinct diagonals you're counting, and what parts of the code handle each one.  With the following approach, we do each one individually:  

int diagonal_length = min(rows, cols)
tmpArray = new int[diagonal_length];

//first major diagonal
for(int i = 0; i &lt; diagonal_length;i++)
  tmpArray[i] = values[i][i];
if (count(tmpArray))
  return true;

//second major diagonal
for(int i = 0; i &lt; diagonal_length;i++)
  tmpArray[i] = values[i][cols - 1 - i];
if (count(tmpArray))
  return true;

//first minor diagonal
for(int i = 0; i &lt; diagonal_length;i++)
  tmpArray[i] = values[rows - 1 - i][i];
if (count(tmpArray))
  return true;

//second minor diagonal
for(int i = 0; i &lt; diagonal_length;i++)
  tmpArray[i] = values[rows - 1 - i][cols - 1 - i];
if (count(tmpArray))
  return true;

return false;


The big advantage of this proposed rewrite is not in speed or algorithms, simply a matter of code clarity.  It's easier to test and examine this code; e.g. the count function can be tested separately.  You can also easily print out the tmpArray variable to check that the right thing is being counted at the beginning of count(), and this is a must if you want to be sure this code is working properly.

Important note:: I haven't tested any of this code yet!!  Errors are fairly likely, but the idea should work either way.