如何在JavaFX应用程序启动时删除Java图标?

时间:2015-06-04 13:52:00

标签: java javafx-8

我在启动JavaFX应用程序时遇到了麻烦。加载应用程序时,Windows任务栏中的Icon是Java图标,而不是我自己的图标,只需一秒钟。

@Override
public final void start(final Stage stage) {

    MainController controller = new MainController();
    Scene scene = new Scene(controller.getRoot());

    stage.setTitle("Geex");
    stage.getIcons().addAll(
            new Image(App.class.getResourceAsStream("/application/images/icon_16.png")),
            new Image(App.class.getResourceAsStream("/application/images/icon_32.png")),
            new Image(App.class.getResourceAsStream("/application/images/icon_48.png")),
            new Image(App.class.getResourceAsStream("/application/images/icon_64.png")),
            new Image(App.class.getResourceAsStream("/application/images/icon_128.png")),
            new Image(App.class.getResourceAsStream("/application/images/icon_256.png"))
    );
    stage.setScene(scene);
    stage.setMinHeight(FRAME_HEIGHT);
    stage.setMinWidth(FRAME_WIDTH);
    stage.setMaximized(true);
    stage.show();

}

0 个答案:

没有答案