Package javax.swing

Examples of javax.swing.UIDefaults


    /**
     * Adds look and feel constants for Help components into UIDefaults table.
     */
    static void installLookAndFeelDefaults() {
        LookAndFeel lnf = UIManager.getLookAndFeel();
        UIDefaults table = UIManager.getLookAndFeelDefaults();

  debug("installLookAndFeelDefaults - " + lnf);

        if ((lnf != null) && (table != null)) {
      if (lnf.getID().equals("Motif")) {
    installMotifDefaults(table);
      } else if (lnf.getID().equals("Windows")) {
    installWindowsDefaults(table);
      } else if (lnf.getID().equals("GTK")) {
    installGTKDefaults(table);
      } else {
    // Default
    installMetalDefaults(table);
      }
  }
  debug ("verifing UIDefaults; HelpUI=" + table.getString("HelpUI"));

    }
View Full Code Here


        private final int iconHeight;
        private final int iconWidth;

        public TristateCheckBoxIcon() {
            // Assume that the UI has not changed since the checkbos was created
            UIDefaults defaults = UIManager.getLookAndFeelDefaults();
            final Icon icon = (Icon) defaults.get("CheckBox.icon");
            iconHeight = icon.getIconHeight();
            iconWidth = icon.getIconWidth();
        }
View Full Code Here

        // is created with a huge initialCapacity
        // giving a dummy key/value array as parameter reduces that capacity
        // to length/2.
        Object[] dummies = new Object[] { 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0,
                7, 0, 8, 0, 9, 0, 10, 0, };
        defaultRenderersByColumnClass = new UIDefaults(dummies);
        defaultRenderersByColumnClass.clear();
        // configured default table renderer (internally LabelProvider)
        setDefaultRenderer(Object.class, new DefaultTableRenderer());
        setDefaultRenderer(Number.class, new DefaultTableRenderer(
                StringValues.NUMBER_TO_STRING, JLabel.RIGHT));
View Full Code Here

    protected void createDefaultEditors() {
        Object[] dummies = new Object[] { 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0,
                7, 0, 8, 0, 9, 0, 10, 0,

        };
        defaultEditorsByColumnClass = new UIDefaults(dummies);
        defaultEditorsByColumnClass.clear();
        // defaultEditorsByColumnClass = new UIDefaults();

        // Objects
        setLazyEditor(Object.class, "org.jdesktop.swingx.JXTable$GenericEditor");
View Full Code Here

     * @since 1.6
     */
    public int getBaseline(JComponent c, int width, int height) {
        super.getBaseline(c, width, height);
        int rowHeight = list.getFixedCellHeight();
        UIDefaults lafDefaults = UIManager.getLookAndFeelDefaults();
        Component renderer = (Component)lafDefaults.get(
                BASELINE_COMPONENT_KEY);
        if (renderer == null) {
            ListCellRenderer lcr = (ListCellRenderer)UIManager.get(
                    "List.cellRenderer");

            // fix for 6711072 some LAFs like Nimbus do not provide this
            // UIManager key and we should not through a NPE here because of it
            if (lcr == null) {
                lcr = new DefaultListCellRenderer();
            }
           
            renderer = lcr.getListCellRendererComponent(
                    list, "a", -1, false, false);
            lafDefaults.put(BASELINE_COMPONENT_KEY, renderer);
        }
        renderer.setFont(list.getFont());
        // JList actually has much more complex behavior here.
        // If rowHeight != -1 the rowHeight is either the max of all cell
        // heights (layout orientation != VERTICAL), or is variable depending
View Full Code Here

*/
public class LookAndFeel {

   
    public static void initSystemColorDefaults() {
        UIDefaults table = UIManager.getLookAndFeelDefaults();
       

        //Color green = new ColorUIResource(0, 255, 0);
        //Color white = new ColorUIResource(255, 255, 255);
        Color bordes = new ColorUIResource(100, 100, 100);
        table.putDefaults(new Object[] { "control", bordes //
                //, "activeCaption", getWindowTitleBackground() //
                //, "activeCaptionBorder", getPrimaryControlShadow() //
                //, "control", getControl() //
                //, "controlDkShadow", getControlDarkShadow() //
                //, "controlHighlight", getControlHighlight() //
View Full Code Here

                });
    }

    public static void initComponentDefaults() {

        UIDefaults table = UIManager.getLookAndFeelDefaults();
        initSystemColorDefaults();
        // loadResourceBundle(table);

        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction  //
                , "ctrl V", DefaultEditorKit.pasteAction //
                , "ctrl X", DefaultEditorKit.cutAction //
                , "COPY", DefaultEditorKit.copyAction //
                , "PASTE", DefaultEditorKit.pasteAction //
                , "CUT", DefaultEditorKit.cutAction //
                , "shift LEFT", DefaultEditorKit.selectionBackwardAction //
                , "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction //
                , "shift RIGHT", DefaultEditorKit.selectionForwardAction //
                , "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction //
                , "ctrl LEFT", DefaultEditorKit.previousWordAction //
                , "ctrl KP_LEFT", DefaultEditorKit.previousWordAction //
                , "ctrl RIGHT", DefaultEditorKit.nextWordAction //
                , "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction //
                , "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction //
                , "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction //
                , "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction //
                , "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction //
                , "ctrl A", DefaultEditorKit.selectAllAction //
                , "HOME", DefaultEditorKit.beginLineAction //
                , "END", DefaultEditorKit.endLineAction //
                , "shift HOME", DefaultEditorKit.selectionBeginLineAction //
                , "shift END", DefaultEditorKit.selectionEndLineAction //
                , "typed \010", DefaultEditorKit.deletePrevCharAction //
                , "DELETE", DefaultEditorKit.deleteNextCharAction //
                , "RIGHT", DefaultEditorKit.forwardAction //
                , "LEFT", DefaultEditorKit.backwardAction //
                , "KP_RIGHT", DefaultEditorKit.forwardAction //
                , "KP_LEFT", DefaultEditorKit.backwardAction //
                , "ENTER", JTextField.notifyAction //
                , "ctrl BACK_SLASH", "unselect"/* DefaultEditorKit.unselectAction */ //
                , "control shift O", "toggle-componentOrientation"/* DefaultEditorKit.toggleComponentOrientation */
        });

        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction //
                , "ctrl V", DefaultEditorKit.pasteAction //
                , "ctrl X", DefaultEditorKit.cutAction //
                , "COPY", DefaultEditorKit.copyAction //
                , "PASTE", DefaultEditorKit.pasteAction //
                , "CUT", DefaultEditorKit.cutAction //
                , "shift LEFT", DefaultEditorKit.selectionBackwardAction //
                , "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction //
                , "shift RIGHT", DefaultEditorKit.selectionForwardAction //
                , "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction //
                , "ctrl LEFT", DefaultEditorKit.previousWordAction //
                , "ctrl KP_LEFT", DefaultEditorKit.previousWordAction //
                , "ctrl RIGHT", DefaultEditorKit.nextWordAction //
                , "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction //
                , "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction //
                , "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction //
                , "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction //
                , "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction //
                , "ctrl A", DefaultEditorKit.selectAllAction //
                , "HOME", DefaultEditorKit.beginLineAction //
                , "END", DefaultEditorKit.endLineAction //
                , "shift HOME", DefaultEditorKit.selectionBeginLineAction //
                , "shift END", DefaultEditorKit.selectionEndLineAction //
                , "UP", DefaultEditorKit.upAction //
                , "KP_UP", DefaultEditorKit.upAction //
                , "DOWN", DefaultEditorKit.downAction //
                , "KP_DOWN", DefaultEditorKit.downAction //
                , "PAGE_UP", DefaultEditorKit.pageUpAction //
                , "PAGE_DOWN", DefaultEditorKit.pageDownAction //
                , "shift PAGE_UP", "selection-page-up" //
                , "shift PAGE_DOWN", "selection-page-down" //
                , "ctrl shift PAGE_UP", "selection-page-left" //
                , "ctrl shift PAGE_DOWN", "selection-page-right" //
                , "shift UP", DefaultEditorKit.selectionUpAction //
                , "shift KP_UP", DefaultEditorKit.selectionUpAction //
                , "shift DOWN", DefaultEditorKit.selectionDownAction //
                , "shift KP_DOWN", DefaultEditorKit.selectionDownAction //
                , "ENTER", DefaultEditorKit.insertBreakAction //
                , "typed \010", DefaultEditorKit.deletePrevCharAction //
                , "DELETE", DefaultEditorKit.deleteNextCharAction //
                , "RIGHT", DefaultEditorKit.forwardAction //
                , "LEFT", DefaultEditorKit.backwardAction //
                , "KP_RIGHT", DefaultEditorKit.forwardAction //
                , "KP_LEFT", DefaultEditorKit.backwardAction //
                , "TAB", DefaultEditorKit.insertTabAction //
                , "ctrl BACK_SLASH", "unselect"/* DefaultEditorKit.unselectAction */ //
                , "ctrl HOME", DefaultEditorKit.beginAction //
                , "ctrl END", DefaultEditorKit.endAction //
                , "ctrl shift HOME", DefaultEditorKit.selectionBeginAction //
                , "ctrl shift END", DefaultEditorKit.selectionEndAction //
                , "ctrl T", "next-link-action" //
                , "ctrl shift T", "previous-link-action" //
                , "ctrl SPACE", "activate-link-action" //
                , "control shift O", "toggle-componentOrientation"/* DefaultEditorKit.toggleComponentOrientation */
        });

        final Object[] internalFrameIconArgs = new Object[1];
        internalFrameIconArgs[0] = new Integer(16);

        //
        // DEFAULTS TABLE
        //               
        Font defaultFont = new Font("Dialog", Font.PLAIN, 10);

        Object[] defaults = { "TextField.focusInputMap", fieldInputMap//
                // , "TextField.font", defaultFont//
                , "Panel.background", new java.awt.Color(211, 207, 192)//
                , "ScrollPane.background", new java.awt.Color(211, 207, 192)//
                , "ScrollPane.foreground", new java.awt.Color(211, 207, 192)//
                , "Viewport.background", new java.awt.Color(211, 207, 192)//
                , "Table.selectionBackground", new java.awt.Color(179, 179, 179)//
                , "TableHeader.background", new java.awt.Color(179, 179, 179)//
                , "ToolBar.background", new java.awt.Color(178, 174, 173)//
                , "Button.background", new java.awt.Color(178, 174, 173)//
                , "Label.foreground", Color.black//
                , "Label.background"new java.awt.Color(178, 174, 173) //
                , "ComboBox.font", defaultFont//
                //, "ComboBox.foreground", new java.awt.Color(211, 207, 192) //
                , "ComboBox.background", new java.awt.Color(178, 174, 173) //
                , "ComboBox.border", BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(178, 174, 173)) //               
                , "List.font", defaultFont//
                , "Label.font", new Font("Dialog", Font.PLAIN, 10)//
                , "PasswordField.focusInputMap", fieldInputMap//
                ,
                /*
                 * "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new
                 * Object[] { "RIGHT", "negativeUnitIncrement", "KP_RIGHT",
                 * "negativeUnitIncrement", "DOWN", "positiveUnitIncrement",
                 * "KP_DOWN", "positiveUnitIncrement", "ENTER",
                 * "positiveUnitIncrement", //"TAB", "PAGE_DOWN",
                 * "positiveBlockIncrement", "LEFT", "positiveUnitIncrement",
                 * "KP_LEFT", "positiveUnitIncrement", "UP",
                 * "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement",
                 * "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll",
                 * "END", "maxScroll" }),
                 */

                "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { //
                        "RIGHT", "unitScrollRight" //
                                , "KP_RIGHT", "unitScrollRight" //
                                , "DOWN", "unitScrollDown" //
                                , "KP_DOWN", "unitScrollDown" //
                                , "LEFT", "unitScrollLeft" //
                                , "KP_LEFT", "unitScrollLeft" //
                                , "UP", "unitScrollUp" //
                                , "KP_UP", "unitScrollUp", "PAGE_UP" //
                                , "scrollUp" //
                                , "PAGE_DOWN", "scrollDown" //
                                , "ctrl PAGE_UP", "scrollLeft" //
                                , "ctrl PAGE_DOWN", "scrollRight" //
                                , "ctrl HOME", "scrollHome" //
                                , "ctrl END", "scrollEnd" //
                                , "ENTER", "unitScrollDown" //
                                , "shitf TAB", "unitScrollUp" //
                                , "TAB", "unitScrollDown" }) //

                // Internal Frame Defaults
                // , "InternalFrame.icon", internalFrameIcon
                // , "InternalFrame.icon", getInternalFrameDefaultMenuIcon()

                // "InternalFrame.icon", getInternalFrameDefaultMenuIcon() //
                // , "InternalFrame.border", getInternalFrameBorder() //
                // , "InternalFrame.optionDialogBorder", getOptionDialogBorder()
                // //
                // , "InternalFrame.paletteBorder", getPaletteBorder() //
                , "InternalFrame.paletteTitleHeight", new Integer(11) //
                // , "InternalFrame.paletteCloseIcon", getPaletteCloseIcon() //
                // , "InternalFrame.closeIcon", getInternalFrameCloseIcon(16) //
                // , "InternalFrame.maximizeIcon",
                // getInternalFrameMaximizeIcon(16) //
                // , "InternalFrame.iconifyIcon",
                // getInternalFrameMinimizeIcon(16) //
                // , "InternalFrame.minimizeIcon",
                // getInternalFrameAltMaximizeIcon(16) //
                // , "InternalFrame.font", getWindowTitleFont() //
                , "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu" //
                        , "ctrl SPACE", "showSystemMenu" //
                        , "ESCAPE", "hideSystemMenu" }

                //, "Menu.acceleratorFont", subTextFont //
                , "Menu.arrowIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuArrowIcon") //
                , "Menu.border", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$MenuItemBorder") //
                , "Menu.borderPainted", Boolean.TRUE, "Menu.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon") //
                //, "Menu.font", defaultFont //
                , "Menu.menuPopupOffsetX", new Integer(0) //
                , "Menu.menuPopupOffsetY", new Integer(0) //
                , "Menu.submenuPopupOffsetX", new Integer(-5) //
                , "Menu.submenuPopupOffsetY", new Integer(-2) //
                , "MenuBar.border", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$MenuBarBorder") //
                , "MenuBar.font", defaultFont //
                , "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" } //
                , "MenuItem.acceleratorDelimiter", "-" //
                , "MenuItem.acceleratorFont", defaultFont //
                , "MenuItem.arrowIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon") //
                , "MenuItem.border", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$MenuItemBorder") //
                , "MenuItem.borderPainted", Boolean.TRUE //
                , "MenuItem.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon") //
                , "MenuItem.commandSound", "sounds/MenuItemCommand.wav" //
                , "MenuItem.font", defaultFont
       
                , "Table.font", defaultFont //
                , "Table.scrollPaneBorder", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$ScrollPaneBorder"//
                , "TableHeader.cellBorder", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$TableHeaderBorder"//
                , "TableHeader.font", defaultFont  //
                , "TextArea.font", defaultFont //
                // , "TextArea.caretForeground", getUserTextColor() //
                , "TextArea.focusInputMap", multilineInputMap //
                , "TextPane.font", defaultFont //
                // , "TextPane.caretForeground", getUserTextColor() //
                , "TextPane.focusInputMap", multilineInputMap //

                /*
                 * , "TextPane.selectionBackground", table.get("textHighlight")
                 * , "TextPane.selectionForeground", table.get("textHighlightText")
                 * , "TextPane.background", table.get("window")
                 * , "TextPane.foreground", table.get("textText")
                 * , "TextPane.caretForeground", getUserTextColor()
                 * , "EditorPane.selectionBackground", table.get("textHighlight")
                 * , "EditorPane.selectionForeground", table.get("textHighlightText")
                 * , "EditorPane.background", table.get("window")
                 * , "EditorPane.foreground", table.get("textText")
                 */
                , "EditorPane.font", defaultFont //
                // , "EditorPane.caretForeground", getUserTextColor()//
                /*
                 * "TextField.focusInputMap", fieldInputMap,
                 * "PasswordField.focusInputMap", fieldInputMap,
                 * "TextArea.focusInputMap", multilineInputMap,
                 * "TextPane.focusInputMap", multilineInputMap,
                 * "EditorPane.focusInputMap", multilineInputMap,
                 */

                , "PasswordField.font", defaultFont

                // "RadioButton.background", new java.awt.Color(178, 174, 173),
                , "RadioButton.foreground", Color.black //
                // , "RadioButton.disabledText", getInactiveControlTextColor()
                // //
                // , "RadioButton.select", getControlShadow() //
                // , "RadioButton.icon", getRadioButtonIcon() //
                , "RadioButton.font", defaultFont//
                // , "RadioButton.focus", getFocusColor() //
                , "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed" //
                        , "released SPACE", "released" }) //
                // , "ScrollBar.background", getControl() //
                // , "ScrollBar.highlight", getControlHighlight() //
                // , "ScrollBar.shadow", getControlShadow() //
                // , "ScrollBar.darkShadow", getControlDarkShadow() //
                // , "ScrollBar.thumb", getPrimaryControlShadow() //
                // , "ScrollBar.thumbShadow", getPrimaryControlDarkShadow() //
                // , "ScrollBar.thumbHighlight", getPrimaryControl() //
                , "ScrollBar.width", new Integer(14) //
                , "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE //
                , "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "negativeUnitIncrement" //
                        , "KP_RIGHT", "negativeUnitIncrement" //
                        , "DOWN", "positiveUnitIncrement" //
                        , "KP_DOWN", "positiveUnitIncrement" //
                        , "PAGE_DOWN", "positiveBlockIncrement" //
                        , "LEFT", "positiveUnitIncrement" //
                        , "KP_LEFT", "positiveUnitIncrement" //
                        , "UP", "negativeUnitIncrement" //
                        , "KP_UP", "negativeUnitIncrement" //
                        , "PAGE_UP", "negativeBlockIncrement" //
                        , "HOME", "minScroll" //
                        , "END", "maxScroll" }) //

                // Progress Bar
                // , "ProgressBar.foreground", getPrimaryControlShadow() //
                // , "ProgressBar.background", getControl() //
                // , "ProgressBar.foregroundHighlight",
                // getPrimaryControlShadow() //
                // , "ProgressBar.backgroundHighlight", getControl() //
                // , "ProgressBar.selectionForeground", getControl() //
                // , "ProgressBar.selectionBackground",
                // getPrimaryControlDarkShadow() //
                // , "ProgressBar.border", progressBarBorder //
                , "ProgressBar.cellSpacing", new Integer(0) //
                , "ProgressBar.cellLength", new Integer(1) //
                , "SplitPane.background", new java.awt.Color(178, 174, 173) //
                , "SplitPane.foreground", new java.awt.Color(178, 174, 173) //
                //, "SplitPane.border", xx//
                , "SplitPane.dividerSize", new Integer(3) //
                // , "CheckBox.background", getControl() //
                // , "CheckBox.foreground", getControlTextColor() //
                // , "CheckBox.disabledText", getInactiveControlTextColor() //
                // , "Checkbox.select", getControlShadow() //
                , "CheckBox.font", defaultFont //
                //, "CheckBox.focus", getFocusColor() //
                //, "CheckBox.icon", getCheckBoxIcon() //
                , "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed" //
                        , "released SPACE", "released" }), };

        table.putDefaults(defaults);

    }
View Full Code Here

    void testOverrides() {
        Color defaultColor = label.getBackground();

        // override default background
        UIDefaults defs = new UIDefaults();
        defs.put("Label.background", new ColorUIResource(Color.RED));
        label.putClientProperty("Nimbus.Overrides", defs);
        check(Color.RED);

        // change overriding color
        defs = new UIDefaults();
        defs.put("Label.background", new ColorUIResource(Color.GREEN));
        label.putClientProperty("Nimbus.Overrides", defs);
        check(Color.GREEN);

        // remove override
        label.putClientProperty("Nimbus.Overrides", null);
View Full Code Here

        // more specific setting is in global defaults
        UIManager.put("Label[Enabled].background", new ColorUIResource(Color.RED));

        // less specific one is in overrides
        UIDefaults defs = new UIDefaults();
        defs.put("Label.background", new ColorUIResource(Color.GREEN));

        // global wins
        label.putClientProperty("Nimbus.Overrides", defs);
        check(Color.RED);
View Full Code Here

            jta = (JTextArea) c;

            JTextArea editor = jta;

            UIDefaults uidefaults = XToolkit.getUIDefaults();

            String prefix = getPropertyPrefix();
            Font f = editor.getFont();
            if ((f == null) || (f instanceof UIResource)) {
                editor.setFont(uidefaults.getFont(prefix + ".font"));
            }

            Color bg = editor.getBackground();
            if ((bg == null) || (bg instanceof UIResource)) {
                editor.setBackground(uidefaults.getColor(prefix + ".background"));
            }

            Color fg = editor.getForeground();
            if ((fg == null) || (fg instanceof UIResource)) {
                editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
            }

            Color color = editor.getCaretColor();
            if ((color == null) || (color instanceof UIResource)) {
                editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
            }

            Color s = editor.getSelectionColor();
            if ((s == null) || (s instanceof UIResource)) {
                editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
            }

            Color sfg = editor.getSelectedTextColor();
            if ((sfg == null) || (sfg instanceof UIResource)) {
                editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
            }

            Color dfg = editor.getDisabledTextColor();
            if ((dfg == null) || (dfg instanceof UIResource)) {
                editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
            }

            Border b = new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight);
            editor.setBorder(new BorderUIResource.CompoundBorderUIResource(
                b,new EmptyBorder(2, 2, 2, 2)));

            Insets margin = editor.getMargin();
            if (margin == null || margin instanceof UIResource) {
                editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
            }
        }
View Full Code Here

TOP

Related Classes of javax.swing.UIDefaults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.