Comparison of Two Methods to beautify the jframe Interface

Source: Internet
Author: User

Comparison of Two Methods to beautify the jframe Interface

 

To make the jframe interface more beautiful, you can use the jbuton and jlabel with icons for GUI programming in Java.

The jbutton is used for embellishment. The example interface is as follows:

 

 

The example interface is as follows:

 

 

 

Comparing the two images, we can easily find that the jbutton method is like hanging the jbutton on the jframe first and then pasting the image on the jbutton; using jlabel is like directly attaching an image to a jframe. Therefore, it is obvious that jframe uses a jlabel with an icon for vertices to achieve more beautiful results.

 

Note: When jlabel is used to embellish jframe, images may not be displayed during running. I have encountered similar problems during my experiments. I think this may be related to the operating system, because I am running on my computer and cannot always run the jlabel with images, however, I run the same program on the computer in the school data center to achieve the expected results. The running effect on your computer is as follows:

 

 

 

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.