<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

    主站蜘蛛池模板: 亚洲高清国产拍精品26U| 亚洲日本韩国在线| 亚洲视频免费播放| 最新国产乱人伦偷精品免费网站| 国产精品二区三区免费播放心| a视频在线观看免费| 57pao国产成永久免费视频| 免费无码又爽又高潮视频| 亚洲国产精品无码专区影院| 99精品免费视频| 亚洲精品成人无码中文毛片不卡| 免费精品久久天干天干| 亚洲AV无码国产精品色午友在线| 亚洲AV无码专区在线观看成人 | 亚洲av最新在线观看网址| 成人免费看片又大又黄| 亚洲A∨无码无在线观看| 亚洲国产精品免费视频| 亚洲日本在线免费观看| 皇色在线视频免费网站| 亚洲av无码专区在线电影天堂| 四虎影视在线永久免费看黄| ww在线观视频免费观看w| 成人黄软件网18免费下载成人黄18免费视频 | 亚洲人成无码网站| 日韩免费人妻AV无码专区蜜桃| 亚洲欧洲另类春色校园小说| 午夜神器成在线人成在线人免费| 男女超爽视频免费播放| 亚洲欧洲日产国码无码网站| 18观看免费永久视频| 亚洲成AV人片在WWW| 亚洲人JIZZ日本人| 国产卡二卡三卡四卡免费网址| 老色鬼久久亚洲AV综合| 精品无码免费专区毛片| 美国免费高清一级毛片| 亚洲va在线va天堂va不卡下载| 成人男女网18免费视频| 黄色短视频免费看| 伊人久久大香线蕉亚洲五月天|