JavaFx 2 设置窗口图标.
@Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); Scene scene = new Scene(root); //设置标题 stage.setTitle("测试"); stage.setScene(scene); //设置窗口的图标. stage.getIcons().add(new Image( Test.class.getResourceAsStream("/resource/orange-ball.png"))); stage.show(); }
原文地址:http://blog.csdn.net/snail_spoor/article/details/45177751