question: private void commercialButtonClicked ( String command ) { int length = Integer . parseInt ( command ) ; JToggleButton button = commercialButtons . get ( length ) ; if ( button . isSelected ( ) ) { if ( scheduledCommercialTime == 0 ) { runCommercial ( length ) ; } else { scheduledCommercialLength = length ; update ( ) ; } } else { scheduledCommercialTime = 0 ; setCommercialResult ( "Canceled scheduled commercial." ) ; } }
target:  One of the commercial buttons was clicked. Find out which one by the action command and check if it was selected/unselected.