pavanreddyboppidi / rest-client

Automatically exported from code.google.com/p/rest-client
Apache License 2.0
0 stars 0 forks source link

Font in Bold #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The default font in Swing for JButton, JTabbedPane, JLabel is:

[family=Dialog,name=Dialog,style=bold,size=12]

The Bold face for all these components look offensive. Need to de-bold it.

Original issue reported on code.google.com by subwiz on 12 Mar 2008 at 6:05

GoogleCodeExporter commented 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

GoogleCodeExporter commented 9 years ago
The BOLD looked better than the PLAIN font.

Original comment by subwiz on 12 Mar 2008 at 5:26

GoogleCodeExporter commented 9 years ago

Original comment by subwiz on 12 Mar 2008 at 5:26