【问题标题】:How to calculate Label width in JavaFx before adding it to the node?在将其添加到节点之前如何计算 JavaFx 中的标签宽度? 【发布时间】:2013-09-02 10:18:15 【问题描述】: 在添加到父节点之前,有什么方法可以根据添加的文本计算标签的宽度?到场景? 【问题讨论】: How to calculate the pixel width of a String in JavaFX? 的可能重复项 标签: label javafx 【解决方案1】: 在 fx8 中,您必须在节点上调用 impl_processCss(true) 【讨论】: