JFrame replaces the default coffee mug icon on the title bar

Source: Internet
Author: User

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 ~ ~ ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.