How do i find out what color a certain pixel is?

I'm writing a little applet using awt that draws a number of line of the screen. The lines are drawn as single points and move around the screen using velocity vectors. When they hit the edge they bounce at random. I need to detect when a line hits another line. I thought that if i look ahead of the line to see if the color is not the default background then the line could bounce. So what i need is a method that accepts x,y co-ords and returns the color at those co-ords. With thanks.

Hello, This idea is perhaps not as slick as being able to test a pixel for its color... What about maintaining an array of the pixels that you have already drawn to? Then just test the upcoming pixel with the current pixels in your array to determine if you should bounce or not. Just an idea. Good Luck.