question: private void updateStatus ( ) { String statusText ; if ( ! game . isTerminal ( currState ) ) { String toMove = ( String ) game . getPlayer ( currState ) ; statusText = "Next move: " + toMove ; statusBar . setForeground ( toMove . equals ( "red" ) ? Color . RED : Color . YELLOW ) ; } else { String winner = null ; for ( int i = 0 ; i < 2 ; i ++ ) if ( game . getUtility ( currState , game . getPlayers ( ) [ i ] ) == 1 ) winner = game . getPlayers ( ) [ i ] ; if ( winner != null ) statusText = "Color " + winner + " has won. Congratulations!" ; else statusText = "No winner :-(" ; statusBar . setForeground ( Color . WHITE ) ; } if ( searchMetrics != null ) statusText += "    " + searchMetrics ; statusBar . setText ( statusText ) ; }
target:  Updates the status bar. 