Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: Replacing the coffee cup icon in the top-left corner of the Window

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!

like image 910
bguiz Avatar asked Sep 17 '10 02:09

bguiz


2 Answers

JFrame.setIconImage(Image image) does exactly that.

like image 74
Rotsor Avatar answered Oct 21 '22 21:10

Rotsor


Look at the setIconImage method.

like image 27
TofuBeer Avatar answered Oct 21 '22 21:10

TofuBeer