Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 javafx 中创建自定义按钮。按钮必须有 3 个标签。一个上标签一个中心标签和一个下标签
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);