Four interface styles for Java interface creation
The original Java interface is not very beautiful. The following describes four styles:
Usage:
Paste the following code into public static void main (string [] Arg) {}, before the main interface class.
Of course, you also need to import,
Import javax. Swing. uimanager;
Try {
Uimanager. setlookandfeel ("com. Sun. java. Swing. plaf. nimbus. nimbuslookandfeel"); // Nimbus style, which will only appear after jdk6 update10
// Uimanager. setlookandfeel (uimanager. getsystemlookandfeelclassname (); // The current system Style
// Uimanager. setlookandfeel ("com. Sun. java. Swing. plaf. motif. motiflookandfeel"); // motif style, blue-black
// Uimanager. setlookandfeel (uimanager. getcrossplatformlookandfeelclassname (); // cross-platform Java Style
// Uimanager. setlookandfeel ("com. Sun. java. Swing. plaf. Windows. windowslookandfeel"); // Windows style
// Uimanager. setlookandfeel ("javax. Swing. plaf. Windows. windowslookandfeel"); // Windows style
// Uimanager. setlookandfeel ("javax. Swing. plaf. Metal. metallookandfeel"); // Java Style
// Uimanager. setlookandfeel ("com. Apple. MrJ. Swing. maclookandfeel"); // to be investigated,
} Catch (exception e ){
E. printstacktrace ();
}
// The following statement is not tested. Add it directly to main ().
However, you need to use the updatecomponentui () method! Otherwise it will be ineffective.
That is, swingutlilites. updatecomponenttreeui (getcontentpare ());