Thursday, June 7, 2012

Synthetica Look And Feel Java Swing

11 comments

How to Apply Synthetica Look And Feel to JFrame in Netbeans


Here I am going to explain how to apply Synthetica Look And Feel to a JFrame in Netbeans,in the previous tutorial I was explained how to apply Nimbus Look and Feel Java Swing to a JFrame.You will be able to apply

  • SyntheticaSkyMetallicLookAndFeel
  • SyntheticaBlueMoonLookAndFeel
  • SyntheticaBlueIceLookAndFeel
  • SyntheticaWhiteVisionLookAndFeel
  • and SystemLookAndFeel which will your OS look and feel.
To apply Synthetica look and feel you must add Synthetica libraries to your project class path.

This code will remove your current look and feel which will help to apply new look and feel clearly.

UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());

To apply new look and feel you must use this code snip which will update all Component with new look and feel

SwingUtilities.updateComponentTreeUI(this);



Look and Feel change function


private void changeLookandFeel() {
        try {

            UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());
            SyntheticaLookAndFeel.setWindowsDecorated(false);
            UIManager.setLookAndFeel(UIMANAGER_STRING);

//             for (int i = 0; i < LookAndFeel.getFrames().length; ++i) {
//                SwingUtilities.updateComponentTreeUI(LookAndFeel.getFrames()[i]);
//                SwingUtilities.updateComponentTreeUI(this);
//            }
            SwingUtilities.updateComponentTreeUI(this);

        } catch (Exception ex) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

Synthetica Blue Moon Look And Feel

Synthetica Blue Moon Look And Feel

Synthetica Blue Moon Look And Feel


Synthetica White Vision Look And Feel

Synthetica White Vision Look And Feel

Synthetica White Vision Look And Feel


System Look And Feel (Windows 7)

System Look And Feel (Windows 7 Look And Feel)


Synthetica Sky Metallic Look And Feel

Synthetica Sky Metallic Look And Feel

Synthetica Sky Metallic Look And Feel


Synthetica Blue Ice Look And Feel

Synthetica Blue Ice Look And Feel

SyntheticaBlueIceLookAndFeel


Download the Netbean project from here Synthetica Look and Feel, you will be find libraries in the lib folder

 
Look And Feel Netbeans Project

11 comments:

Nikos Maravitsas said...

Hi Chathura,

Nice blog! Is there an email address I can contact you in private?

Javin Paul said...
This comment has been removed by the author.
Javin Paul said...

Indeed a nice tip. this can also be a good question one can ask to Java Swing developer, worth including in my list of Swing interview questions.

Chathura Wijesinghe said...

Hi Nikos I am on google plus you can add me..

vighanesh gursale said...

Chatura it show an exception that class not found..... in netbeans

Chathura Wijesinghe said...

What is the JDK version is it 7.0 ? use JDK 6

vighanesh gursale said...

Ok i'll try to use JDK 6 could you give me your email id to cantact you

vighanesh gursale said...

Thanks chatura it works in jdk 6 thankx alot

Rhythm Master said...

this article is really helpful Thank you man Thanks a lot :)

Sajini Gayathri said...

i want to add this theams for JDK version is it 7.0,can u help me

Chathura Wijesinghe said...

@ Sajini Synthetica Standard Look and Feel support Java 1.5 or above

Post a Comment