• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::

            Nimbus – A New Look-and-Feel for Swing

            Nimbus is the name of a look-and-feel designed by Sun for the Java Desktop System; it’s implemented as a GTK theme in the latest Solaris 11 pre-release builds. In 2007, this project was started by Sun’s Swing Team and Ben Galbraith to build a pure Java implementation of this look and feel under a opensource licence. Later on it was decided to pull Nimbus LAF in to the core of the Java platform as part of version 6u10. Nimbus is now available in the beta version of 6u10 available at http://download.java.net/jdk6/.

            The version in the JDK took some of the concepts that were experimented with in the project but is a complete new codebase. It is still based on Synth LAF but is 100% pure vector based using no images. This project is dead for the time being until Nimbus is made opensource through Open JDK. Once that happens it might be pulled back into the project so that we can work on a backport jar that could run on older Java versions than 6u10.

            Nimbus is a new cross-platform Swing look & feel, which packs many features and enhancements. It is not just another look and feel but with some exciting features:

            2D Vector
            All of Nimbus is rendered with 2D vector graphics, there is not one image even for all the icons. This means that the whole of Nimbus is just 56k as a packed JAR which is pretty impressive for a whole rich look and feel.
            High DPI Ready
            As the whole of Nimbus is drawn with shapes and gradients it can be scaled to any resolution.
            Based on Painters
            All painting for components is done with simple stateless implementations of the Painter interface. These painters are stored in the UIDefaults table so they can be replaced if you would like to change the look of components or can be used in your own components if you would like to create a custom table header for example that looks the same as the standard Nimbus one plus something extra.
            Customizable
            All colors, icons and fonts are derived off UIDefaults keys so the whole UI can be customized by changing values in the UIDefaults table.
            Easy to skin 3rd party components to fit in
            All of the colors, fonts, icons, borders and painters are exposed through the UIDefaults table which means they are available to your 3rd party components to help you skin them in a Nimbus style.

            Usage

            To use the Nimbus Look & Feel, simply call the setLookAndFeel methods from UIManager:

                    try {
                        UIManager.setLookAndFeel(
                                "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                    } catch (UnsupportedLookAndFeelException e) {
                        // handle exception
                    } catch (ClassNotFoundException e) {
                        // handle exception
                    } catch (InstantiationException e) {
                        // handle exception
                    } catch (IllegalAccessException e) {
                        // handle exception
                    }

            Alternatively, you can either specify the L&F from swing.properties file or from a command line. To use the swing.properties files, specify the swing.defaultlaf property. The file (if exists) is located under <jre install>\lib:

            # Swing properties
            swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

            To specify the L&F from command line, use the following when running your Java application:

            -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel   


            From: http://javaforweb.wordpress.com/2008/05/05/nimbus-a-new-look-and-feel-for-swing/


            public static void main(String[] args) {

                    try {

                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");

                    } catch (UnsupportedLookAndFeelException e) {

                        // handle exception

                    } catch (ClassNotFoundException e) {

                        // handle exception

                    } catch (InstantiationException e) {

                        // handle exception

                    } catch (IllegalAccessException e) {

                        // handle exception

                    }


                    SwingUtilities.invokeLater(new Runnable() {

                        @Override

                        public void run() {

                            createGUIAndShow();

                        }

                    });

                }

            posted on 2010-12-26 04:34 逛奔的蝸牛 閱讀(2962) 評論(0)  編輯 收藏 引用 所屬分類: Java
            久久综合亚洲鲁鲁五月天| 久久精品国产亚洲麻豆| 色综合合久久天天给综看| 久久亚洲国产精品五月天婷| 久久综合鬼色88久久精品综合自在自线噜噜 | 久久精品成人免费看| 99久久国产综合精品五月天喷水| 一本久久a久久精品综合夜夜 | 国内精品欧美久久精品| 亚洲欧洲久久av| 无码人妻久久一区二区三区免费| 久久综合九色综合久99| 国内精品九九久久精品| 色综合久久最新中文字幕| 久久精品国产99国产精品亚洲 | 无码人妻少妇久久中文字幕| 久久久久99精品成人片直播| 蜜臀久久99精品久久久久久| 99久久99久久久精品齐齐| 久久久久国产精品人妻 | 囯产精品久久久久久久久蜜桃| 99精品久久久久久久婷婷| 亚洲精品无码久久久久sm| 久久久久一级精品亚洲国产成人综合AV区| A级毛片无码久久精品免费| 三级韩国一区久久二区综合| 久久免费精品一区二区| 久久丫精品国产亚洲av| 99久久国产宗和精品1上映| 99久久精品免费看国产| 亚洲狠狠久久综合一区77777| 久久男人Av资源网站无码软件| 婷婷久久综合| 午夜精品久久久久久影视riav| 久久久久综合中文字幕| 久久精品国产99久久久香蕉| 日本三级久久网| 国产精品无码久久综合网| 国产精品美女久久久久网| 国产91色综合久久免费| 一级做a爰片久久毛片人呢|