如何在javafx中创建自定义按钮。按钮必须有3个标签。上标签中心LAbel和下标签
答案 0 :(得分:1)
Button button = new Button();
VBox threeLabels = new VBox();
threeLabels.setAlignment(Pos.CENTER);
threeLabels.getChildren.setAll(
new Label("upper"),
new Label("center"),
new Label("lower")
);
button.setGraphic(threeLabels);