Java Swing Font Size genSizedLabel(String text, float fontSize)

Here you can find the source of genSizedLabel(String text, float fontSize)

Description

gen Sized Label

License

Apache License

Declaration

public static JLabel genSizedLabel(String text, float fontSize) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.JLabel;

public class Main {
    public static JLabel genSizedLabel(String text, float fontSize) {
        JLabel label = new JLabel(text, JLabel.CENTER);
        label.setFont(label.getFont().deriveFont(fontSize));
        return label;
    }/*w  ww .  j  ava  2  s  .c  o m*/
}

Related

  1. calculateTextSize(final String text, final int fontSize)
  2. getBaseFontSize()
  3. getCheckBoxBorder(int fontSize, boolean ltr)
  4. getDefaultFontSize()
  5. getFontRelativeSize(int size)