Atitit. GUI interface Skins and skin Resurfacing summary java. NET C + +

Source: Internet
Author: User

Atitit. GUI interface skins and skin Resurfacing summary java. NET C + +

1. Swing Skin 1

1.1. Windows style 1

1.2. MAC Style ( liquid frame) 1

2. How to add a watermark to an application or a background? 2

3. Popular swing Skin pack substance, Jtattoo 2

C + + skin qt directly supports CSS , easy .

. NET WinForm to take effect immediately ...

When designing swing, Sun took into account the visual sense of the control (look and feel), which is the separation of appearance and function, and the ability to download independent software and skin packs on the web for skin changes.

But swing's skin looks like it's going to be restarted ...

Author:: Old Wow's paw attilax Ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

1. Swingof Skin

1.1. Windowsstyle

And so on, by default Java style is selected.
Let's take a look at the skin that comes with the swing system:

Java code

1./**

2. * use the skins in WINDOWS in SWING 's own skin

3. * Insert the Segment code in the main function

4. * ( Note: To place it in front of the window definition statement )

5. */

6. try{

7. Javax.swing.UIManager.setLookAndFeel ("Com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

8.}catch (Exception e) {

9. E.printstacktrace ();

10.}

1.2. MacStyle (Liquid frame)

Mac theme element.

Java code

1. Uimanager.setlookandfeel ("Com.birosoft.liquid.LiquidLookAndFeel");

2. Liquidlookandfeel.setliquiddecorations (True, "Mac");


To achieve this, simply add the code before the window starts the function. There are other settings in the liquid theme pack that provide two sets of themes that remove the Mac parameters from the above code, namely:

Java code

1. Uimanager.setlookandfeel ("Com.birosoft.liquid.LiquidLookAndFeel");

2. Liquidlookandfeel.setliquiddecorations (TRUE);

To change the title bar in fact, as long as one sentence is enough, that is, in the main method to add such a sentence:

jframe.setdefaultlookandfeeldecorated ( true );  

If you want to let jdialog also change, but also add: jdilog.setdefaultlookandfeeldecorated (TRUE);

2. How to add a watermark to an application or a background?

Refer to the How to use the Swing skin pack substance-winning diary-NetEase blog. htm

3. CommonSwingSkin PackSubstance,, Jtattoo

Play Cool Java Interface Development Learn Notes "three" using Swing skin mechanism - Egg-sore Mr. Codex -Iteye Technical website . htm

Atitit. GUI interface Skins and skin Resurfacing summary java. NET C + +

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.