private void checkForPrompt ( ) { // Text has been entered, remove the prompt if ( document . getLength ( ) > 0 ) { setVisible ( false ) ; return ; } // Prompt has already been shown once, remove it if ( showPromptOnce && focusLost > 0 ) { setVisible ( false ) ; return ; } // Check the Show property and component focus to determine if the // prompt should be displayed. if ( component . hasFocus ( ) ) { if ( show == Show . ALWAYS || show == Show . FOCUS_GAINED ) setVisible ( true ) ; else setVisible ( false ) ; } else { if ( show == Show . ALWAYS || show == Show . FOCUS_LOST ) setVisible ( true ) ; else setVisible ( false ) ; } }
Check whether the prompt should be visible or not . The visibility will applyChanges on updates to the Document and on focus changes .