簡體   English   中英

JavaFX通過css設置標簽文本

[英]JavaFX set label text by css

我想知道如果通過javafx-css可以設置標簽文本。 在官方文檔中我找到了一個參考

-fx-text: "whatever";

但是沒有用,基本上我正在尋找和等效的css3

content: "whatever";

這里指定: W3School

這在JavaFX中是不可能的,您可以通過從Label獲取所有可定制屬性來輕松驗證這一點:

Label label = new Label();
label.getCssMetaData().stream().map(CssMetaData::getProperty).sorted().forEach(System.out::println);

產生以下列表(不包括-fx-text或允許您根據CSS參考指南設置內容的任何內容):

-fx-alignment
-fx-blend-mode
-fx-content-display
-fx-cursor
-fx-effect
-fx-ellipsis-string
-fx-focus-traversable
-fx-font
-fx-graphic
-fx-graphic-text-gap
-fx-label-padding
-fx-line-spacing
-fx-max-height
-fx-max-width
-fx-min-height
-fx-min-width
-fx-opacity
-fx-opaque-insets
-fx-padding
-fx-position-shape
-fx-pref-height
-fx-pref-width
-fx-region-background
-fx-region-border
-fx-rotate
-fx-scale-shape
-fx-scale-x
-fx-scale-y
-fx-scale-z
-fx-shape
-fx-skin
-fx-snap-to-pixel
-fx-text-alignment
-fx-text-fill
-fx-text-overrun
-fx-translate-x
-fx-translate-y
-fx-translate-z
-fx-underline
-fx-wrap-text
visibility

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM