private static void fixUiIssues() {
        Toolkit tk = Toolkit.getDefaultToolkit();

        // Add shadow for popup components.
        if (!shadowPopupEnabled) {
            PopupFactory.setSharedInstance(SHADOW_POPUP_FACTORY);
            shadowPopupEnabled = true;
        }

        // Show default popup menus for components that have context actions.
        if (!casPopupEnabled) {
            tk.addAWTEventListener(CONTEXT_POPUP_HANDLER, AWTEvent.MOUSE_EVENT_MASK);
            casPopupEnabled = true;
        }

        // Enlarge the group layout's indent distance.
        LayoutStyle.setInstance(new GroupLayoutStyle());

        // Fix specific L&F issues.
        UIDefaults uid = UIManager.getLookAndFeelDefaults();
        String laf = UIManager.getLookAndFeel().getName();
        if (laf.equals("Windows")
                && Double.parseDouble(System.getProperty("os.version")) >= 6.0
                && Boolean.TRUE.equals(tk.getDesktopProperty("win.xpstyle.themeActive"))) {
            uid.put("ToolTipUI", AeroToolTipUI.class.getName());
            uid.put("ComboBoxUI", AeroComboBoxUI.class.getName());
            uid.put("TextField.border", new AeroEditorBorderUIResource(3, 5, 3, 5));
            uid.put("PasswordField.border", new AeroEditorBorderUIResource(3, 5, 3, 5));
            uid.put("ComboBox.border", new AeroEditorBorderUIResource(1, 3, 1, 1));
            uid.put("Spinner.border", new AeroEditorBorderUIResource(3, 3, 3, 3));
            uid.put("ScrollPane.border",
                    new AeroScrollPaneBorder(uid.getBorder("ScrollPane.border")));
            uid.put("ToolTip.border", new AeroToolTipBorderUIResource());
            uid.put("Menu.border", new EmptyBorderUIResource(0, 3, 0, 3));
            uid.put("TextArea.inactiveBackground",
                    UIManager.get("TextArea.disabledBackground"));
            uid.put("EditorPane.inactiveBackground",
                    UIManager.get("EditorPane.disabledBackground"));
            uid.put("TextPane.inactiveBackground",
                    UIManager.get("TextPane.disabledBackground"));

            if (!aeroEditorBorderMonitored) {
                tk.addAWTEventListener(AERO_EDITOR_BORDER_HANDLER,
                        AWTEvent.FOCUS_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
                aeroEditorBorderMonitored = true;
            }
        } else {
            if (laf.equals("Nimbus")) {
                uid.put("TextField[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("TextField[Enabled].backgroundPainter")));
                uid.put("FormattedTextField[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter(
                                (AbstractRegionPainter) UIManager.get(
                                "FormattedTextField[Enabled].backgroundPainter")));
                uid.put("PasswordField[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("PasswordField[Enabled].backgroundPainter")));
                uid.put("TextArea[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("TextArea[Enabled].backgroundPainter")));
                uid.put("TextArea[Enabled+NotInScrollPane].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("TextArea[Enabled+NotInScrollPane].backgroundPainter")));
                uid.put("EditorPane[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("EditorPane[Enabled].backgroundPainter")));
                uid.put("TextPane[Enabled].backgroundPainter",
                        new NimbusTextBackgroundPainter((AbstractRegionPainter)
                                UIManager.get("TextPane[Enabled].backgroundPainter")));
            }

            if (aeroEditorBorderMonitored) {
                tk.removeAWTEventListener(AERO_EDITOR_BORDER_HANDLER);
                aeroEditorBorderMonitored = false;
            }
        }
    }