Java Swing UIManager makeNative()

Here you can find the source of makeNative()

Description

Attempts to set the current L&F to native, and perform appearance tweaks to mimic the current OS's L&F.

License

LGPL

Declaration

public static void makeNative() 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import javax.swing.*;

public class Main {
    /**//from   w  w  w  .j a  v a2  s .c om
     * Attempts to set the current L&F to native, and perform appearance tweaks
     * to mimic the current OS's L&F. Has a large positive effect on Mac
     * systems.
     */
    public static void makeNative() {
        // Mac tweaks
        System.setProperty("apple.laf.useScreenMenuBar", "true");
        System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Amber IDE");
        System.setProperty("apple.awt.showGrowBox", "true");
        System.setProperty("apple.awt.brushMetalLook", "true");

        System.setProperty("sun.java2d.noddraw", "true");

        System.setProperty("swing.aatext", "true");

        JFrame.setDefaultLookAndFeelDecorated(false);
        JDialog.setDefaultLookAndFeelDecorated(false);
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);
        ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
        ToolTipManager.sharedInstance().setReshowDelay(0);

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

Related

  1. isMetalLnF()
  2. isMnemonicHidden()
  3. listUIResources(String res)
  4. loadPlasticLnF()
  5. loadUIManager()
  6. makeSplitpaneNice()
  7. makeToolbarNice()
  8. noAltBg()
  9. paintFocus(Graphics2D g, Shape shape, int biggestStroke)