This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about setIconImage()

 
eLL Pascual
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make setIconImage() work?

this is my source code:

code:
----------------------------------------------------------------------------

public notepad(){//constructor
...
...
loadFrameIcon();
}

private void loadFrameIcon(){
URL imgURL = null;
ImageIcon imgIcon = null;

imgURL = notepad.class.getResource("images/notepadIcon.gif");
imgIcon = new ImageIcon(imgURL);
Image img = imgIcon.getImage();
this.setIconImage(img);
}

----------------------------------------------------------------------------

the error is:

cannot find symbol
this.setIconImage(img);
symbol: method setIconImage(java.awt.Image)
location: class notepad

Should I import something?
In the tutorial, the only import is .ImageIcon;

Thanks!
 
Norazanita Adnan
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


hope this can help you...
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by eLL Pascual:
How can I make setIconImage() work?

By either creating the method yourself, or have your class extend a class with the method like JFrame.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic