Java Utililty Methods Swing Font Set

List of utility methods to do Swing Font Set

Description

The list of methods to do Swing Font Set are organized into topic(s).

Method

voidsetUIFont(FontUIResource f)
Set the default font for all Swing components.
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource) {
        UIManager.put(key, f);
voidsetUIFont(FontUIResource f)
Sets the default font for all Swing components.
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource) {
        UIManager.put(key, f);
voidsetUIFont(FontUIResource f)
set UI Font
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource)
        UIManager.put(key, f);
voidsetUIFont(javax.swing.plaf.FontUIResource f)
Forces a default Font for all components of actual JFrame.
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource) {
        FontUIResource orig = (FontUIResource) value;
        Font font = new Font(f.getFontName(), orig.getStyle(), f.getSize());
        UIManager.put(key, new FontUIResource(font));
...
voidsetUIFont(javax.swing.plaf.FontUIResource f)
sets the default font for all Swing components.
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);
voidsetUIFont(javax.swing.plaf.FontUIResource f)
set UI Font
Enumeration<?> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value != null && value instanceof javax.swing.plaf.FontUIResource)
        UIManager.put(key, f);
voidsetUIFont(javax.swing.plaf.FontUIResource f)
set UI Font
Enumeration<Object> 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);
voidsetUIFont(javax.swing.plaf.FontUIResource font)
Sets default font of the application
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value != null && value instanceof javax.swing.plaf.FontUIResource)
        UIManager.put(key, font);
voidsetUIFont(String font)
set UI Font
for (Enumeration e = UIManager.getDefaults().keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource)
        UIManager.put(key, new FontUIResource(Font.decode(font)));
voidsetUIFontStyle(final int fontStyle)
Sets the default UI font style.
for (Enumeration<?> en = UIManager.getDefaults().keys(); en.hasMoreElements();) {
    Object key = en.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource) {
        FontUIResource fontRes = (FontUIResource) value;
        UIManager.put(key, new ProxyLazyValue("javax.swing.plaf.FontUIResource", null,
                new Object[] { fontRes.getName(), fontStyle, fontRes.getSize() }));