深圳珠宝网站设计,广州网站建设c2c,德州网站建设 绮畅,合肥网站建设 微笑互联最近在做Java Application的项目#xff0c;对于ui的美观#xff0c;做了一些尝试。有幸看到了JGoodIdes的LookAndFeel包。效果大家可以看看如下连接http://www.jgoodies.com经过试验#xff0c;解决了中文乱码问题#xff0c;下面将经验和大家共分享。LookAndFeel如同css一…最近在做Java Application的项目对于ui的美观做了一些尝试。有幸看到了JGoodIdes的LookAndFeel包。效果大家可以看看如下连接http://www.jgoodies.com经过试验解决了中文乱码问题下面将经验和大家共分享。LookAndFeel如同css一样具体的概念大家可以参考其他文章这里不做赘述。http://www.blogjava.net/Files/itaogo/plastic-1.1.3.zip1加载附件plastic-1.1.3.jar到lib path我用的是jbuilderX2创建一个新类AppFont.javaimport 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 methodpublic 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.blogjava.net/Files/itaogo/UISample.rar