This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Similar Threads
hot to change the icon at title bar?
Frame's setIconImage() - optimum image size for title bar & Alt+Tabbing?
loading an image into a frame
title bar icon on a JDialog box
Frame Minimized Icon Problem