Change Look And Feel - Online Code

Description

This is a very useful code fragment which improves your Java application's Look and Feel better. There are various methods provided by the Java. Most of them are following. Besides using these methods you can also use third party Look and Feel's.

Note: I will suggest you to use the default System Look and Feel, instead of using other Look and Feel's because user is use too of his System's Look and Feel.

Source Code

STEP 1 - Get information about Installed Look and Feels

import javax.swing.UIManager;
public class System_Information
{

    public static void main(String args[])
    {
        for ( UIManager.LookAndFeelInfo l :  UIManager.getInstalledLookAndFeels() )
        {
            System.out.println(l.getClassName()
        );}
                       
    }
}

/*

Sample Output:
---------------

javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel

*/

Note: After doing this, you can collect the all information about the installed Look and Feels class names. Now you can use any of them.

STEP 2 - Using the Look and Feels in Application

import java.awt.Container;
import java.awt.e
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.




Comments

No comment yet. Be the first to post a comment.