Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about setIconImage()

 
eLL Pascual
Greenhorn
Posts: 21
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


hope this can help you...
 
Rob Spoor
Sheriff
Pie
Posts: 20529
54
Chrome Eclipse IDE Java Windows
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic