如何在.ico文件中使用JFrame.setIcon()方法? 我正在使用和ImageIcon作爲參數。編譯錯誤:如何在JFrame中使用setIcon()
CodeBlocksMain.java:33: error: cannot find symbol
setIcon (icon);
^
symbol: method setIcon(ImageIcon)
location: class CodeBlocksMain
1 error
如何在.ico文件中使用JFrame.setIcon()方法? 我正在使用和ImageIcon作爲參數。編譯錯誤:如何在JFrame中使用setIcon()
CodeBlocksMain.java:33: error: cannot find symbol
setIcon (icon);
^
symbol: method setIcon(ImageIcon)
location: class CodeBlocksMain
1 error
setIcon
未定義爲JFrame
。您正在尋找JFrame#setIconImage
謝謝,那就是我一直在尋找的,我知道在未來問你。 – 2013-05-18 20:04:14
不客氣,不要忘記[接受此答案](http://meta.stackexchange.com/a/65088/155831):) – Reimeus 2013-05-18 20:05:54
您需要更多信息,因爲我們無法在上下文中看到帶有錯誤的行。我確實喜歡你顯示了錯誤行。 – 2013-04-26 21:04:35
在JFame中沒有'setIcon',試試這個:'setIconImage(new ImageIcon(「/// your image path」)。getImage());' – 2013-04-26 21:12:08