Java JComponent Height heighten(JComponent component, int px)

Here you can find the source of heighten(JComponent component, int px)

Description

heighten

License

Creative Commons License

Declaration

public static void heighten(JComponent component, int px) 

Method Source Code


//package com.java2s;
/*// w w w  . j av  a  2s .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 heighten(JComponent component, int px) {
        pad(component, 0, px);
    }

    public static void pad(JComponent component, int w, int h) {
        Dimension size = component.getPreferredSize();
        size.width += w;
        size.height += h;
        component.setPreferredSize(size);
    }
}

Related

  1. adjustHeight(JComponent comp, int height)
  2. fixHeight(JComponent c, int height)
  3. getComponentHeight(JComponent component)
  4. getMinimumHeight(JComponent comp)
  5. makeEqualHeight(JComponent reference, JComponent... others)
  6. normalizeHeight(JComponent... components)
  7. sameHeight(JComponent[] components, int height)
  8. setComponentHeight(JComponent setme, JComponent getme)