public void setTargetWidth ( int targetWidth ) { if ( targetWidth <= 0 ) { throw new IllegalArgumentException ( "Invalid target width '" + targetWidth + "'" ) ; } _constraints . width = targetWidth ; _constraints . height = 0 ; invalidate ( "setTargetWidth" ) ; }
Sets the target width for this label . Text will be wrapped to fit into this width forcibly breaking words on character boundaries if a single word is too long to fit into the target width . Calling this method will annul any previously established target height as we must have one degree of freedom in which to maneuver .