Java JButton Settings growFont(JComponent button)

Here you can find the source of growFont(JComponent button)

Description

grow Font

License

Creative Commons License

Declaration

public static void growFont(JComponent button) 

Method Source Code


//package com.java2s;
/*//from   w  w w . ja  va  2  s.  c o  m
 * CS 106A
 *
 * This instructor-provided file contains utility functions related to GUIs.
 *
 * Author : Marty Stepp
 * Version: Tue 2014/06/05
 * 
 * This file and its contents are copyright (C) Stanford University and Marty Stepp,
 * licensed under Creative Commons Attribution 2.5 License.  All rights reserved.
 */

import java.awt.*;

import javax.swing.*;

public class Main {
    public static void growFont(JComponent button) {
        growFont(button, 1);
    }

    public static void growFont(JComponent button, int amount) {
        Font font = button.getFont();
        font = font.deriveFont((float) (font.getSize() + amount));
        button.setFont(font);
    }
}

Related

  1. getTextXOffset(AbstractButton c)
  2. getTogglableIconButton(ImageIcon icon)
  3. getWindowFileChooserOKButton(JFileChooser chooser)
  4. groupButtons(AbstractButton... buttons)
  5. groupButtons(final Container container, final boolean recursive)
  6. hasIcon(AbstractButton button)
  7. hasText(AbstractButton button)
  8. hideApproveButton(JFileChooser fileChooser)
  9. hideJFileChooserButtons(JFileChooser sessionFileChooser)