Java JLabel Font unboldLabel(JLabel label)

Here you can find the source of unboldLabel(JLabel label)

Description

unbold Label

License

Open Source License

Declaration

public static JLabel unboldLabel(JLabel label) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 Jeff Martin./*from  ww  w. j  ava  2 s . co  m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public
 * License v3.0 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Contributors:
 * Jeff Martin - initial API and implementation
 ******************************************************************************/

import javax.swing.*;
import java.awt.*;

public class Main {
    public static JLabel unboldLabel(JLabel label) {
        Font font = label.getFont();
        label.setFont(font.deriveFont(font.getStyle() & ~Font.BOLD));
        return label;
    }
}

Related

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