Galen Nare
Galen Nare

Reputation: 336

How to use setIcon() in a JFrame

How do you use the JFrame.setIcon() method with a .ico file? I'm using and ImageIcon as an argument. The compile error:

CodeBlocksMain.java:33: error: cannot find symbol
        setIcon (icon);
        ^
  symbol:   method setIcon(ImageIcon)
  location: class CodeBlocksMain
1 error

Upvotes: 0

Views: 1836

Answers (1)

Reimeus
Reimeus

Reputation: 159864

setIcon is undefined for JFrame. You're looking for JFrame#setIconImage

Upvotes: 5

Related Questions