If you get the same values for every pixel there are several possible reasons.
a) your image has the same values in every pixel
b) you do not change x and y between your calls to getRGB
c) you read something else but the return value of getRGB
solved getRGB(x,y) in Java awt returns for each pixel same value