本文整理匯總了Java中javafx.scene.control.Label.setLineSpacing方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setLineSpacing方法的具體用法?Java Label.setLineSpacing怎麽用?Java Label.setLineSpacing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setLineSpacing方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createLastBuildInfoBox
import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createLastBuildInfoBox( final TileViewModel build ) {
final HBox lastBuildInfoPart = new HBox( );
lastBuildInfoPart.setAlignment( Pos.CENTER );
final ImageView lastBuildIcon = new ImageView( UIUtils.createImage( "icons/lastBuild.png" ) );
lastBuildIcon.setPreserveRatio( true );
lastBuildIcon.setFitWidth( 32 );
final Label lastBuildDate = new Label( );
lastBuildDate.setMinWidth( 110 );
lastBuildDate.setTextAlignment( CENTER );
lastBuildDate.setAlignment( Pos.CENTER );
lastBuildDate.setFont( UIUtils.font( 32, FontWeight.BOLD ) );
lastBuildDate.setTextFill( Color.WHITE );
lastBuildDate.setWrapText( true );
lastBuildDate.setLineSpacing( 2 ); // TODO: Seems do not work
lastBuildDate.setEffect( UIUtils.shadowEffect( ) );
lastBuildDate.textProperty( ).bind( createStringBinding( ( ) -> {
final LocalDateTime localDateTime = build.lastFinishedDateProperty( ).get( );
if ( localDateTime == null )
return "00/00\n00:00";
return localDateTime.format( DateTimeFormatter.ofPattern( "dd/MM\nHH:mm" ) );
}, build.lastFinishedDateProperty( ) ) );
lastBuildInfoPart.getChildren( ).addAll( lastBuildIcon, lastBuildDate );
return lastBuildInfoPart;
}