Java Interface Format

Source: Internet
Author: User

Let me first talk about how to make the program look cool in JBuilder!
The default Java program appearance (lookandfeel) can be changed to the Java appearance, Motif appearance, Windows appearance, and Mac appearance;
Java looks in five different styles: Sapphire, emerald, Ruby, charcoal,
High contrast style.
The method for changing the appearance is as follows:

1: You can directly call one of the following three in the program: Import javax. Swing .*;
Uimanager. setlookandfeel ("com. Sun. java. Swing. plaf. motif. motiflookandfeel ");
Uimanager. setlookandfeel ("javax. Swing. plaf. Metal. metallookandfeel ");
Uimanager. setlookandfeel ("com. Sun. java. Swing. plaf. Windows. windowslookandfeel ");

2: Import javax. Swing .*;
Jmenubar MB = new jmenubar ();
Jmenu file = new jmenu ("Look & feel", true );
Buttongroup = new buttongroup ();
Final uimanager. lookandfeelinfo [] info = uimanager. getinstalledlookandfeels ();
For (INT I = 0; I <info. length; I ++ ){
Jradiobuttonmenuitem item = new
Jradiobuttonmenuitem (info [I]. getname (), I = 0 );
Final string classname = info [I]. getclassname ();
Item. addactionlistener (New actionlistener (){
Public void actionreceivmed (actionevent AE ){
Try {uimanager. setlookandfeel (classname );}
Catch (exception e) {system. Out. println (E );}
Swingutilities. updatecomponenttreeui (touchyfeely. This );}
});
Buttongroup. Add (item );
File. Add (item );
}
MB. Add (File );
Setjmenubar (MB );
}

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.