开发者

Get Icon Image from the Title Bar of the JFrame

I m using Netbeans IDE, I need to get the icon from the title bar of the JFrame and set it in the JButton. Is there any way to get the Icon ima开发者_如何学Goge from the JFrame, there is no getIconImage() method i tried getIconImages() but it doesnt works.


Frame (the superclass of JFrame) has Frame.getIconImage. You should be able to use that.


Image image =Toolkit.getDefaultToolkit().getImage(getClass().getResource("/resources/agfa_icon.jpg"));
setIconImage(image);

Credit: Alain Demortier, here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜