Code example for JTextComponent

Methods: hasFocus

0
		} 
 
		// Check the Show property and component focus to determine if the 
		// prompt should be displayed. 
 
		if (this.component.hasFocus()) {
			if ((this.show == Show.ALWAYS) || (this.show == Show.FOCUS_GAINED)) {
				setVisible(true);
			} else { 
				setVisible(false);
			} 
		} else { 
			if ((this.show == Show.ALWAYS) || (this.show == Show.FOCUS_LOST)) {
				setVisible(true);
			} else { 
				setVisible(false);
			} 
		} 
	}