public synchronized void setBalance ( float balance ) { if ( currentBalance != balance ) { currentBalance = balance ; if ( sourceLine != null && sourceLine . isControlSupported ( FloatControl . Type . BALANCE ) ) { FloatControl balanceControl = ( FloatControl ) sourceLine . getControl ( FloatControl . Type . BALANCE ) ; if ( balance <= balanceControl . getMaximum ( ) && balance >= balanceControl . getMinimum ( ) ) balanceControl . setValue ( balance ) ; } } }
Set the Balance of the sourceLine