Add bounds checking to Robot.getScreenCapture() to ensure the capture area is within Screen bounds.
This will avoid the problem of what an "out of bounds" pixel will be set to and will allow the implementing code to not have to deal with the issue out out of bounds pixels.