Atitit. Gui skin and skin replacement summary java. net c ++, atitit.gui.net
Atitit. Gui skin and skin replacement summary java. net c ++
1. Swing skin 1
1.1. windows style 1
1.2. Mac style (liquid framework) 1
2. How to add a watermark or background to an application? 2
3. Common swing skin package substance, JTattoo 2
C ++ skin qt directly supports css, easy ..
. Net winform ya ten immediately take effect...
Sun considers the view And Feel of the control when designing Swing, that is, the appearance And function separation. It can download independent software And skin packages online for skin replacement.
However, it seems that the change of swing skin will take effect after the restart...
Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
1. Swing skin
1.1. windows style
By default, the java style is used.
Here we will first illustrate the skin that comes with the swing system:
Java code
1 ./**
2. * use WINDOWS skin in SWING's own skin
3. * Insert the code segment in the main function.
4. * (Note: place it before 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. Mac style (liquid Framework)
Mac topic element.
Java code
1. UIManager. setLookAndFeel ("com. birosoft. liquid. LiquidLookAndFeel ");
2. LiquidLookAndFeel. setLiquidDecorations (true, "mac ");
To achieve the above effect, you only need to add the code before the window starts the function. There are other settings in the liquid topic package. Two sets of themes are provided to remove the mac parameters in the above Code, namely:
Java code
1. UIManager. setLookAndFeel ("com. birosoft. liquid. LiquidLookAndFeel ");
2. LiquidLookAndFeel. setLiquidDecorations (true );
To change the title bar, you only need to add one sentence in the main method:
JFrame. setdefalooklookandfeeldecorated (true );
If you want to change JDialog, add JDilog. setdefalooklookandfeeldecorated (true );
2. How to add a watermark or background to an application?
Refer to how to use the Swing skin package substance-log obtained by Zhizhi-wangyi Boke .htm
3. Common swing skin packages: substance, JTattoo
Cool Java interface development and learning notes [3] Using Swing skin mechanism-bag.tar.tar.htm-iteyetechnical website .htm