首页 > 编程语言 > 详细

JavaFx 2 设置窗口图标.

时间:2015-04-22 00:42:08      阅读:2664      评论:0      收藏:0      [点我收藏+]

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();
    }


JavaFx 2 设置窗口图标.

原文:http://blog.csdn.net/snail_spoor/article/details/45177751

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!