question: public void flip ( ) { if ( greenlight ) { img = null ; repaint ( ) ; img = stop . getImage ( ) ; } else { img = null ; repaint ( ) ; img = go . getImage ( ) ; } greenlight = ! greenlight ; firePropertyChange ( "State" , ! greenlight , greenlight ) ; }
target:  Quick method which flips the state of the stoplight to green if the current state is red and red if the current state is green. Again the image is always coupled to the greenlight boolean.