我在启动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();
}