//here the paint method is reading a variable that is changed by our thread
//run changes LEDlight every 1/2 second, notice that run explicitally calls repaint()
//which calls paint()
if (LEDlight == true) //LEDon?
g.setColor(Color.red);
else //if not black
g.setColor(Color.black);
g.fillOval(100,100,50,50);