[英]How to create LEGEND (text in chart border) in JavaFX
这类似于他们在c#
拥有的节点。 我不知道JavaFX
是否具有这种类型的节点。 在SceneBuilder
我在Pane
周围添加了边框,并在边框顶部添加了Label
。 然后,将根AnchorPane
的背景设置为白色,并将Label
的背景设置为白色。 我没有在Group
尝试此操作,但我认为这可能是个好主意。
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: White;" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane fx:id="pane" layoutX="200.0" layoutY="100.0" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: BLACK;" />
<Label layoutX="218.0" layoutY="92.0" style="-fx-background-color: WHITE;" text="Label" />
</children>
</AnchorPane>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.