UIManager.put("Button.font", new Font(...)); 想设置所有的控件,需要遍历..
解决方案 »
- java中的方法trim()
- 求教关于JList和ArrayList的问题
- 去掉JMenuItem左侧的空白
- 编程出现点问题求救下
- HashMap 和 HashSet 的区别问题
- jbuilder8 enterprise trial版本用注册机注册后是否和jbuilder8 enterprise一样?
- 请教JAVADOC的用法,要详细的,谢谢!!!
- 用一个串替换另外一个串中的子串
- 请教--有关java网络编程
- 我用sqlserver的jdbc连数据库,在jb6下运行正常,为什么用tomcat就出错?
- 我用JAVA做APPLICATION的时候,连接数据库,我怎么样才能把表中的信息现实在SWING中的TEXTAREA中啊???解决马上给分!!!!
- 请教一个菜鸟问题,如何获得vct.toArray()?
public static void setUIFont (javax.swing.plaf.FontUIResource f){
//
// sets the default font for all Swing components.
// ex.
// setUIFont (new javax.swing.plaf.FontUIResource("Serif",Font.ITALIC,12));
//
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get (key);
if (value instanceof javax.swing.plaf.FontUIResource)
UIManager.put (key, f);
}
} //在显示一个frame之前使用这个方法
javax.swing.plaf.FontUIResource f=new FontUIResource("宋体",Font.PLAIN,12);
setUIFont(f);
UIManager.put("ToolTip.font",font);
UIManager.put("Table.font",font);
UIManager.put("TableHeader.font",font);
UIManager.put("TextField.font",font);
UIManager.put("ComboBox.font",font);
UIManager.put("TextField.font",font);
UIManager.put("PasswordField.font",font);
UIManager.put("TextArea.font",font);
UIManager.put("TextPane.font",font);
UIManager.put("EditorPane.font",font);
UIManager.put("FormattedTextField.font",font);
UIManager.put("Button.font",font);
UIManager.put("CheckBox.font",font);
UIManager.put("RadioButton.font",font);
UIManager.put("ToggleButton.font",font);
UIManager.put("ProgressBar.font",font);
UIManager.put("DesktopIcon.font",font);
UIManager.put("TitledBorder.font",font);
UIManager.put("Label.font",font);
UIManager.put("List.font",font);
UIManager.put("TabbedPane.font",font);
UIManager.put("MenuBar.font",font);
UIManager.put("Menu.font",font);
UIManager.put("MenuItem.font",font);
UIManager.put("PopupMenu.font",font);
UIManager.put("CheckBoxMenuItem.font",font);
UIManager.put("RadioButtonMenuItem.font",font);
UIManager.put("Spinner.font",font);
UIManager.put("Tree.font",font);
UIManager.put("ToolBar.font",font);
UIManager.put("OptionPane.messageFont",font);
UIManager.put("OptionPane.buttonFont",font);