Four interface styles for Java interface creation

Source: Internet
Author: User

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 ());

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.