create AWT Bold Font - Java java.awt

Java examples for java.awt:Font

Description

create AWT Bold Font

Demo Code


//package com.java2s;

import java.awt.Font;

public class Main {
    public static Font createBoldFont(Font font) {
        if (font == null) {
            throw new NullPointerException("font == null");
        }//from   ww w.j a v a 2  s .c o  m
        String fontName = font.getName();
        int fontSize = font.getSize();
        return new Font(fontName, Font.BOLD, fontSize);
    }
}

Related Tutorials