Java Swing Font Set setMonospacedFont(JComponent component)

Here you can find the source of setMonospacedFont(JComponent component)

Description

set Monospaced Font

License

Open Source License

Declaration

public static void setMonospacedFont(JComponent component) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Font;

import javax.swing.JComponent;

public class Main {
    private static final Font MONOSPACED_FONT = Font.decode("Monospaced");

    public static void setMonospacedFont(JComponent component) {
        if (MONOSPACED_FONT != null)
            component.setFont(MONOSPACED_FONT);
    }// w  ww . j av a2s.c o m
}

Related

  1. setFontRecursively(final JComponent component, final Font font, final boolean childsOnly)
  2. setFontScale(float scale)
  3. setHtmlFont(HTMLDocument doc, Font font)
  4. setItalicFont(JComponent jcomp)
  5. setLabelProperties(JLabel label, Color color, Font font, Color bg)
  6. setSwingFont(Font font)
  7. setTitleLabelFont(JLabel label)
  8. setUIDefaultFont()
  9. setUIFont(final Font font)