有现成可以下载的.jar吗?最好是反编译过的:)
谢!

解决方案 »

  1.   

    兄弟给点代码吧,:P
    我也想MAC一下!!!
    先谢过!
      

  2.   

    import java.awt.Font;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.*;
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.LineBorder;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.BasicLookAndFeel;
    import javax.swing.text.DefaultEditorKit;// Referenced classes of package com.sun.java.swing.plaf.mac:
    //            MacIconFactorypublic class MacLookAndFeel extends BasicLookAndFeel
    {    public MacLookAndFeel()
        {
        }    static final ColorUIResource getAccent()
        {
            return accent;
        }    static final ColorUIResource getAccentDarkShadow()
        {
            return accentDarkShadow;
        }    static final ColorUIResource getAccentHighlight()
        {
            return accentHighlight;
        }    static final ColorUIResource getAccentLightHighlight()
        {
            return accentLightHighlight;
        }    static final ColorUIResource getAccentShadow()
        {
            return accentShadow;
        }    static final ColorUIResource getBlack()
        {
            return black;
        }    static final FontUIResource getControlFont()
        {
            return controlFont;
        }    public String getDescription()
        {
            return "The Apple Macintosh(tm) Look and Feel";
        }    static final ColorUIResource getDisabledControlText()
        {
            return getGray6();
        }    static final ColorUIResource getFocusColor()
        {
            return getAccent();
        }    static final ColorUIResource getGray0()
        {
            return gray0;
        }    static final ColorUIResource getGray1()
        {
            return gray1;
        }    static final ColorUIResource getGray10()
        {
            return gray10;
        }    static final ColorUIResource getGray11()
        {
            return gray11;
        }    static final ColorUIResource getGray12()
        {
            return gray12;
        }    static final ColorUIResource getGray2()
        {
            return gray2;
        }    static final ColorUIResource getGray3()
        {
            return gray3;
        }    static final ColorUIResource getGray4()
        {
            return gray4;
        }    static final ColorUIResource getGray5()
        {
            return gray5;
        }    static final ColorUIResource getGray6()
        {
            return gray6;
        }    static final ColorUIResource getGray7()
        {
            return gray7;
        }    static final ColorUIResource getGray8()
        {
            return gray8;
        }    static final ColorUIResource getGray9()
        {
            return gray9;
        }    public String getID()
        {
            return "Platinum";
        }    public String getName()
        {
            return "Macintosh";
        }    static final FontUIResource getUserFont()
        {
            return userFont;
        }    static final ColorUIResource getUserTextColor()
        {
            return getBlack();
        }    static final ColorUIResource getUserTextHighlightColor()
        {
            return getBlack();
        }    static final ColorUIResource getUserTextHighlightTextColor()
        {
            return getWhite();
        }    static final ColorUIResource getWhite()
        {
            return white;
        }    protected void initClassDefaults(UIDefaults uidefaults)
        {
            super.initClassDefaults(uidefaults);
            String s = "com.sun.java.swing.plaf.mac.";
            Object aobj[] = {
                "ButtonUI", s + "MacButtonUI", "TextFieldUI", s + "MacTextFieldUI", "InternalFrameUI", s + "MacInternalFrameUI", "SliderUI", s + "MacSliderUI", "ScrollBarUI", s + "MacScrollBarUI", 
                "ComboBoxUI", s + "MacComboBoxUI", "SeparatorUI", s + "MacSeparatorUI", "TreeUI", s + "MacTreeUI", "DesktopPaneUI", s + "MacDesktopPaneUI", "ToggleButtonUI", s + "MacToggleButtonUI", 
                "FileChooserUI", s + "MacFileChooserUI", "TabbedPaneUI", s + "MacTabbedPaneUI", "ProgressBarUI", s + "MacProgressBarUI"
            };
            uidefaults.putDefaults(aobj);
        }
      

  3.   

    protected void initComponentDefaults(UIDefaults uidefaults)
        {
            super.initComponentDefaults(uidefaults);
            javax.swing.plaf.basic.BasicBorders.MarginBorder marginborder = new javax.swing.plaf.basic.BasicBorders.MarginBorder();
            javax.swing.text.JTextComponent.KeyBinding akeybinding[] = {
                new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(67, 2), "copy-to-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(86, 2), "paste-from-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(88, 2), "cut-to-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 1), "selection-backward"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 1), "selection-forward"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 2), "caret-previous-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 2), "caret-next-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 3), "selection-previous-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 3), "selection-next-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(65, 2), "select-all"), 
                new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(36, 0), "caret-begin-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(35, 0), "caret-end-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(36, 1), "selection-begin-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(35, 1), "selection-end-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(10, 0), "notify-field-accept")
            };
            javax.swing.text.JTextComponent.KeyBinding akeybinding1[] = {
                new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(67, 2), "copy-to-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(86, 2), "paste-from-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(88, 2), "cut-to-clipboard"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 1), "selection-backward"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 1), "selection-forward"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 2), "caret-previous-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 2), "caret-next-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(37, 3), "selection-previous-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(39, 3), "selection-next-word"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(65, 2), "select-all"), 
                new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(36, 0), "caret-begin-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(35, 0), "caret-end-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(36, 1), "selection-begin-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(35, 1), "selection-end-line"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(38, 0), "caret-up"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(40, 0), "caret-down"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(33, 0), "page-up"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(34, 0), "page-down"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(38, 1), "selection-up"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(40, 1), "selection-down"), 
                new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(10, 0), "insert-break"), new javax.swing.text.JTextComponent.KeyBinding(KeyStroke.getKeyStroke(9, 0), "insert-tab")
            };
            javax.swing.plaf.BorderUIResource.CompoundBorderUIResource compoundborderuiresource = new javax.swing.plaf.BorderUIResource.CompoundBorderUIResource(new MacBorders.ButtonBorder(), marginborder);
            javax.swing.plaf.BorderUIResource.CompoundBorderUIResource compoundborderuiresource1 = new javax.swing.plaf.BorderUIResource.CompoundBorderUIResource(new MacBorders.DefaultButtonBorder(), compoundborderuiresource);
            javax.swing.plaf.BorderUIResource.CompoundBorderUIResource compoundborderuiresource2 = new javax.swing.plaf.BorderUIResource.CompoundBorderUIResource(new MacBorders.ToggleButtonBorder(), marginborder);
            javax.swing.plaf.BorderUIResource.LineBorderUIResource lineborderuiresource = new javax.swing.plaf.BorderUIResource.LineBorderUIResource(getBlack());
            javax.swing.plaf.BorderUIResource.LineBorderUIResource lineborderuiresource1 = new javax.swing.plaf.BorderUIResource.LineBorderUIResource(getFocusColor());
            InsetsUIResource insetsuiresource = new InsetsUIResource(4, 2, 0, 6);
            String s = new String("-");
      

  4.   

    Object aobj[] = {
                "TextField.font", getUserFont(), "TextField.caretForeground", getUserTextColor(), "TextField.border", new MacBorders.TextFieldBorder(), "PasswordField.font", getUserFont(), "PasswordField.caretForeground", getUserTextColor(), 
                "PasswordField.border", new MacBorders.TextFieldBorder(), "TextArea.font", getUserFont(), "TextArea.caretForeground", getUserTextColor(), "TextPane.selectionBackground", uidefaults.get("textHighlight"), "TextPane.selectionForeground", uidefaults.get("textHighlightText"), 
                "TextPane.background", uidefaults.get("window"), "TextPane.foreground", uidefaults.get("textText"), "TextPane.font", getUserFont(), "TextPane.caretForeground", getUserTextColor(), "EditorPane.selectionBackground", uidefaults.get("textHighlight"), 
                "EditorPane.selectionForeground", uidefaults.get("textHighlightText"), "EditorPane.background", uidefaults.get("window"), "EditorPane.foreground", uidefaults.get("textText"), "EditorPane.font", getUserFont(), "EditorPane.caretForeground", getUserTextColor(), 
                "TextField.keyBindings", akeybinding, "PasswordField.keyBindings", akeybinding, "TextArea.keyBindings", akeybinding1, "TextPane.keyBindings", akeybinding1, "EditorPane.keyBindings", akeybinding1, 
                "Button.background", uidefaults.get("control"), "Button.foreground", uidefaults.get("controlText"), "Button.disabledText", getDisabledControlText(), "Button.select", getGray8(), "Button.selectText", getWhite(), 
                "Button.border", compoundborderuiresource1, "Button.font", getControlFont(), "Button.margin", new InsetsUIResource(0, 10, 0, 10), "CheckBox.background", uidefaults.get("control"), "CheckBox.foreground", uidefaults.get("controlText"), 
                "CheckBox.disabledText", getDisabledControlText(), "CheckBox.font", getControlFont(), "CheckBox.icon", new MacBorders.CheckBoxIcon(), "RadioButton.background", uidefaults.get("control"), "RadioButton.foreground", uidefaults.get("controlText"), 
                "RadioButton.disabledText", getDisabledControlText(), "RadioButton.icon", new MacBorders.RadioButtonIcon(), "RadioButton.font", getControlFont(), "RadioButton.on", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonEnabledOn.gif"), "RadioButton.off", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonEnabledOff.gif"), 
                "RadioButton.pressedOn", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonPressedOn.gif"), "RadioButton.pressedOff", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonPressedOff.gif"), "RadioButton.disabledOn", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonDisabledOn.gif"), "RadioButton.disabledOff", LookAndFeel.makeIcon(getClass(), "icons/RadioButtonDisabledOff.gif"), "ToggleButton.background", getGray2(), 
                "ToggleButton.foreground", uidefaults.get("controlText"), "ToggleButton.select", getGray8(), "ToggleButton.text", uidefaults.get("controlText"), "ToggleButton.disabledText", getDisabledControlText(), "ToggleButton.disabledSelectedText", getDisabledControlText(), 
                "ToggleButton.disabledBackground", getGray1(), "ToggleButton.disabledSelectedBackground", getGray3(), "ToggleButton.border", compoundborderuiresource2, "ToggleButton.font", getControlFont(), "InternalFrame.closeIcon", LookAndFeel.makeIcon(getClass(), "icons/WindowCloseEnabled.gif"), 
                "InternalFrame.maximizeIcon", LookAndFeel.makeIcon(getClass(), "icons/WindowZoomEnabled.gif"), "InternalFrame.iconifyIcon", LookAndFeel.makeIcon(getClass(), "icons/WindowMinimizeEnabled.gif"), "InternalFrame.closePressed", LookAndFeel.makeIcon(getClass(), "icons/WindowClosePressed.gif"), "InternalFrame.maximizePressed", LookAndFeel.makeIcon(getClass(), "icons/WindowZoomPressed.gif"), "InternalFrame.iconifyPressed", LookAndFeel.makeIcon(getClass(), "icons/WindowMinimizePressed.gif"), 
                "InternalFrame.minimizeIcon", LookAndFeel.makeIcon(getClass(), "icons/WindowZoomEnabled.gif"), "InternalFrame.font", getControlFont(), "InternalFrame.icon", null, "InternalFrame.border", new MacBorders.InternalFrameBorder(), "InternalFrame.windowShadeBorder", new MacBorders.WindowShadeBorder(), 
                "ToolTip.font", getUserFont(), "ToolTip.border", lineborderuiresource, "ToolTip.background", uidefaults.get("info"), "ToolTip.foreground", uidefaults.get("infoText"), "Slider.border", null, 
                "Slider.foreground", getGray4(), "Slider.background", getGray1(), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(8), "Slider.minorTickLength", new Integer(5), 
                "Slider.horizontalThumbIcon", MacIconFactory.getSliderHorizontalThumbIcon(), "Slider.verticalThumbIcon", MacIconFactory.getSliderVerticalThumbIcon(), "ProgressBar.font", getUserFont(), "ProgressBar.foreground", getAccent(), "ProgressBar.background", uidefaults.get("control"), 
                "ProgressBar.selectionForeground", uidefaults.get("control"), "ProgressBar.selectionBackground", getAccent(), "ProgressBar.border", new LineBorder(getBlack()), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.cellLength", new Integer(1), 
                "ComboBox.background", uidefaults.get("control"), "ComboBox.foreground", uidefaults.get("controlText"), "ComboBox.selectionBackground", getAccentShadow(), "ComboBox.selectionForeground", getWhite(), "ComboBox.listBackground", uidefaults.get("menu"), 
                "ComboBox.listForeground", uidefaults.get("menuText"), "ComboBox.font", getControlFont(), "TitledBorder.font", getControlFont(), "TitledBorder.titleColor", uidefaults.get("controlText"), "Label.font", getControlFont(), 
                "Label.background", uidefaults.get("control"), "Label.foreground", uidefaults.get("controlText"), "Label.disabledForeground", getDisabledControlText(), "List.focusCellHighlightBorder", new EmptyBorder(0, 0, 0, 0), "ScrollBar.border", new MacBorders.ScrollBarBorder(), 
                "ScrollBar.track", getGray4(), "ScrollBar.trackHighlight", getGray3(), "ScrollBar.trackLightHighlight", getGray2(), "ScrollBar.trackShadow", getGray6(), "ScrollBar.trackDarkShadow", getGray7(), 
                "ScrollBar.thumb", getAccentHighlight(), "ScrollBar.thumbShadow", getAccent(), "ScrollBar.thumbDarkShadow", getAccentShadow(), "ScrollBar.thumbHighlight", getAccentLightHighlight(), "ScrollBar.thumbLightHighlight", getGray0(), 
                "ScrollBar.pressedThumb", getAccent(), "ScrollBar.pressedThumbShadow", getAccentShadow(), "ScrollBar.pressedThumbDarkShadow", getAccentDarkShadow(), "ScrollBar.pressedThumbHighlight", getAccentHighlight(), "ScrollBar.pressedThumbLightHighlight", getAccentLightHighlight(),