【发布时间】:2021-03-12 06:12:43
【问题描述】:
如何使用 VirtualizedScrollPane(在 GenericStyledArea-#Adding Scrollbars to the Area 中解释)为 JavaFx Scene Builder 中的 InlineCssTextArea 添加滚动功能?有什么建议吗?
【问题讨论】:
标签: javafx textarea scenebuilder scrollpane
如何使用 VirtualizedScrollPane(在 GenericStyledArea-#Adding Scrollbars to the Area 中解释)为 JavaFx Scene Builder 中的 InlineCssTextArea 添加滚动功能?有什么建议吗?
【问题讨论】:
标签: javafx textarea scenebuilder scrollpane
我找到了一种解决方法。手动编辑 FXML 文件。
就像RichtTextFX-Issue 描述的:
<VirtualizedScrollPane
fx:id="sourceContainerTextScreenVirtualizedScrollPane"
layoutX="265.0"
layoutY="98.0">
<content>
<InlineCssTextArea
fx:id="theICA"
layoutX="0.0"
layoutY="0.0"
onKeyReleased="#handler"
onMouseReleased="handelrer2"
prefHeight="277.0"
prefWidth="674.0"
wrapText="true"/>
</content>
</VirtualizedScrollPane>
但还要添加一个
@FXML private VirtualizedScrollPane<InlineCssTextArea> sourceContainerTextScreenVirtualizedScrollPane;
到你的控制器,如果你想控制它。否则在我的代码中它也可以在没有控制器声明的情况下工作。 我希望这会对您有所帮助,直到它被包含在 Scene Builder 中。
【讨论】: