The recent development of Java applications, the development of the user interface in the Java swing encountered a problem, that is, the generated window title bar of the Sun Company's coffee cup icon has been replaced.
After trying to replace the success. Here is the solution.
In fact, there are a lot of solutions online, but many tried and found unsuccessful. Said after the unsuccessful reasons. The first steps are as follows:
1. Find a suitable picture
2. Get pictures in code
After using
JFrame frame = new JFrame ("Your own title content");
frame.seticonimage (image);
This will replace the coffee cup.
Many of the methods used on the Internet are often not replaced, the reason is very likely that the picture is too large. So find a suitable picture.
This picture can't be too big to be as small as possible.
Other ways to get pictures on the internet can try ~ ~ ~