Here you can find the source of setNoBoldJLabels(Container parent)
public static void setNoBoldJLabels(Container parent)
//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 } } }