views:

94

answers:

2

Java Swing applications by default have the Java coffee cup icon appear in the top left corner of the application.

I would like to replace this with my own image - what API is used?

Can this be done at run time, or must something be done at install time?

Thanks!

+4  A: 

JFrame.setIconImage(Image image) does exactly that.

Rotsor
+2  A: 

Look at the setIconImage method.

TofuBeer
-1, for duplicate answer, why clutter the forum?
camickr
+1 for a more recent link, albeit 26 seconds later. :-)
trashgod
@camickr It didn't show up as a dup when I posted it... I just found that out now.
TofuBeer
I figured that was the case. When I looked at the question it was answer 14 seconds before I browsed it. The point about a more recent link is another reason why I don't include links to the API. I just point out the method since every programmer should have easy access to the API for whatever version they are using. You can't assume version 5 or 6 is the proper API.
camickr