<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    一切皆可抽象

    大而無形 庖丁解牛 厚積薄發 滌慮玄覽
       ::  ::  ::  ::  :: 管理

    最近在做Java Application的項目,對于ui的美觀,做了一些嘗試。有幸看到了JGoodIdes的LookAndFeel包。
    效果大家可以看看如下連接
            http://www.jgoodies.com
    經過試驗,解決了中文亂碼問題,下面將經驗和大家共分享。
    LookAndFeel如同css一樣,具體的概念大家可以參考其他文章,這里不做贅述。

    http://www.tkk7.com/Files/itaogo/plastic-1.1.3.zip
    1,加載附件plastic-1.1.3.jar到lib path,我用的是jbuilderX
    2,創建一個新類AppFont.java
       import java.awt.*;
       import javax.swing.UIManager;
       public class AppFont()
       {
         public static void setFont(Font pFont){
          UIManager.put("Button.font", pFont);
          UIManager.put("ToggleButton.font", pFont);
          UIManager.put("RadioButton.font", pFont);
          UIManager.put("CheckBox.font", pFont);
          UIManager.put("ColorChooser.font", pFont);
          UIManager.put("ToggleButton.font", pFont);
          UIManager.put("ComboBox.font", pFont);
          UIManager.put("ComboBoxItem.font", pFont);
          UIManager.put("InternalFrame.titleFont", pFont);
          UIManager.put("Label.font", pFont);
          UIManager.put("List.font", pFont);
        UIManager.put("MenuBar.font", pFont);
        UIManager.put("Menu.font", pFont);
        UIManager.put("MenuItem.font", pFont);
        UIManager.put("RadioButtonMenuItem.font", pFont);
        UIManager.put("CheckBoxMenuItem.font", pFont);
        UIManager.put("PopupMenu.font", pFont);
        UIManager.put("OptionPane.font", pFont);
        UIManager.put("Panel.font", pFont);
        UIManager.put("ProgressBar.font", pFont);
        UIManager.put("ScrollPane.font", pFont);
        UIManager.put("Viewport", pFont);
        UIManager.put("TabbedPane.font", pFont);
        UIManager.put("TableHeader.font", pFont);
        UIManager.put("Table.font", pFont);
        UIManager.put("TextField.font", pFont);
        UIManager.put("PasswordFiled.font", pFont);
        UIManager.put("TextArea.font", pFont);
        UIManager.put("TextPane.font", pFont);
        UIManager.put("EditorPane.font", pFont);
        UIManager.put("TitledBorder.font", pFont);
        UIManager.put("ToolBar.font", pFont);
        UIManager.put("ToolTip.font", pFont);
        UIManager.put("Tree.font", pFont);
          }
       }
    3,尋找您的java application 的主程序 
     
      //引入
      import com.jgoodies.plaf.LookUtils;
      import com.jgoodies.plaf.plastic.PlasticLookAndFeel;
     
      //修改程序如下
      //Main method
       public static void main(String[] args) {
        try {
          //原來的,請注釋掉;jbuilder是如此寫法。
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          //修改為
          UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
          UIManager.setLookAndFeel(new PlasticLookAndFeel());
          AppFont.setFont(new java.awt.Font("宋體", 0, 12));
        }
        catch(Exception e) {
          e.printStackTrace();
        }
        new MainApp();
      }
     
     4,附件2 UISample.rar是jbuilder的一個簡單效果的項目。下載地址 http://www.tkk7.com/Files/itaogo/UISample.rar

    主站蜘蛛池模板: 在线观看免费精品国产| 全免费a级毛片免费**视频| 伊人久久亚洲综合| 青青草国产免费国产是公开| 四虎永久在线精品免费观看地址 | 亚洲AV区无码字幕中文色| 成年大片免费视频播放一级 | 免费人成在线观看播放国产| 校园亚洲春色另类小说合集| 免费国产高清视频| 免费无码又爽又黄又刺激网站| 亚洲免费视频一区二区三区| 在线免费观看h片| 2022年亚洲午夜一区二区福利 | 在线观看亚洲电影| 亚洲高清无码专区视频| 一区二区免费电影| 亚洲av永久无码精品网站 | 好男人看视频免费2019中文 | 永久免费av无码网站大全| 亚洲AV成人一区二区三区观看 | 久久久久亚洲AV无码专区首JN| 四虎在线视频免费观看视频| 亚洲AV女人18毛片水真多| 亚洲精品亚洲人成在线观看下载 | 亚洲男人天堂2017| 色窝窝免费一区二区三区| 亚洲AV成人片无码网站| 亚洲人午夜射精精品日韩| 日韩精品久久久久久免费| 亚洲色大成WWW亚洲女子| 亚洲国产精品无码久久久久久曰| 爱丫爱丫影院在线观看免费| 亚洲天堂福利视频| 亚洲A∨精品一区二区三区| 国产精品免费AV片在线观看| 亚洲综合国产成人丁香五月激情| 在线亚洲精品自拍| 无码乱肉视频免费大全合集| 无码毛片一区二区三区视频免费播放| 91亚洲国产成人精品下载|