File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Icon image of frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Icon image of frame" Watch "Icon image of frame" New topic

Icon image of frame

Steven Zeng
Ranch Hand

Joined: Jan 15, 2002
Posts: 41
Now i found a problem at changing the icon image of frame from the default java symbol.I found a method defined in the class of java.awt.frame -
setIconImage(Image image) , but i don't konw how to use the image argument to specify the image i want use in the frame.Thanks.

Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Perhaps java.awt.Toolkit.getDefaultToolkit().getImage( String ) is what you are after.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Steven Zeng
Ranch Hand

Joined: Jan 15, 2002
Posts: 41
Hi,Dirk, you know, the class you offered is a abstract class ,but I don't know how to get a instance of that class , if I don't want to create a subclass of it,can I use java.awt.toolkit class?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Toolkit.getDefaultToolkit() gets the real Toolkit on your system... the implementing class is package private because it changes based on system and you shouldn't access it directly.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Icon image of frame
jQuery in Action, 3rd edition