aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes about setIconImage() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "about setIconImage()" Watch "about setIconImage()" New topic
Author

about setIconImage()

eLL Pascual
Greenhorn

Joined: May 22, 2008
Posts: 21
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

Joined: May 28, 2008
Posts: 44


hope this can help you...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about setIconImage()