JavaFx 2 设置窗口图标.

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
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3