Showing posts with label Swing. Show all posts
Showing posts with label Swing. Show all posts

Wednesday, March 27, 2019

Swing UIManager Keys List - getDefaults method example

javax.swing.UIManager:

UIManager manages the current look and feel, the set of available look and feels, PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.

Java event handler

Specifying the look and feel:

The look and feel can be specified in two distinct ways: by specifying the fully qualified name of the class for the look and feel, or by creating an instance of LookAndFeel and passing it to setLookAndFeel. The following example illustrates setting the look and feel to the system look and feel.   


  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   
The following example illustrates setting the look and feel based on class name:


  UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");