Java JLabel Font setNoBoldJLabels(Container parent)

Here you can find the source of setNoBoldJLabels(Container parent)

Description

set No Bold J Labels

License

Open Source License

Declaration

public static void setNoBoldJLabels(Container parent) 

Method Source Code


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

import java.awt.Component;
import java.awt.Container;

import java.awt.Font;

import javax.swing.JLabel;

public class Main {
    public static void setNoBoldJLabels(Container parent) {
        for (Component comp : parent.getComponents()) {
            if (comp instanceof JLabel) {
                JLabel label = (JLabel) comp;
                Font f = label.getFont();
                label.setFont(f.deriveFont(f.getStyle() & ~Font.BOLD));
            } else if (comp instanceof Container) {
                setNoBoldJLabels((Container) comp);
            }//from   ww w  . j a v a2  s.  co  m
        }
    }
}

Related

  1. bold(final JLabel label)
  2. setBold(JLabel label)
  3. setLabelBold(JLabel existingLabel, boolean bold)
  4. setLabelBold(JLabel label)
  5. unboldLabel(JLabel label)