【发布时间】:2017-01-13 23:54:58
【问题描述】:
【问题讨论】:
【问题讨论】:
您可以将\n 在文本中放置在您想要停止线路的位置,或者在您的按钮上调用setWrapText(true)。
【讨论】:
1- 通过编码
Button btn = new Button ("can wrap that text") ;
btn.wrapTextProperty().setValue(true)
2- 通过 FXML 场景构建器 在按钮的属性下检查换行文本
<Button mnemonicParsing="false" prefHeight="50.0" prefWidth="300.0" text="Can wrap that text" wrapText="true"/>
【讨论】:
使用
btn.wrapTextProperty().setValue(true);
或 如果您已指定要中断的位置,请使用 \n
【讨论】: