2
我正在创建一个示例代码以显示在Javafx中设计的舞台,它不应该只需要最小化和最大化按钮关闭('X')按钮。舞台图标不可见
对于我们正在使用以下代码。
Stage stage = new Stage();
// Here we have load it using JFXML
stage.initModality(Modality.WINDOW_MODAL);
stage.initStyle(StageStyle.UTILITY);
stage.setResizable(true);
if (title != null && !title.trim().isEmpty()) {
stage.setTitle(title);
}
stage.setWidth(w);
stage.setHeight(h);
stage.getIcons().add(new Image(Dialog.class.getResourceAsStream("/image/myicon.png")));
stage.showAndWait();
现在我在舞台上设置的图标不可见。
我缺少什么?