Closed GoogleCodeExporter closed 9 years ago
Change component default font
For all components:
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);
}
}
For particular component:
UIManager.put("Label.font",new Font("Serif",Font.ITALIC,12));
Original comment by subwiz
on 12 Mar 2008 at 6:06
The BOLD looked better than the PLAIN font.
Original comment by subwiz
on 12 Mar 2008 at 5:26
Original comment by subwiz
on 12 Mar 2008 at 5:26
Original issue reported on code.google.com by
subwiz
on 12 Mar 2008 at 6:05