Java JComponent Height sameHeight(JComponent[] components, int height)

Here you can find the source of sameHeight(JComponent[] components, int height)

Description

same Height

License

Open Source License

Declaration

public static void sameHeight(JComponent[] components, int height) 

Method Source Code

//package com.java2s;

import java.awt.Dimension;

import java.util.List;

import javax.swing.JComponent;

public class Main {
    public static void sameHeight(JComponent[] components, int height) {
        for (int i = 0; i < components.length; i++) {
            Dimension size = components[i].getSize();
            size.height = height;/* w  ww. j  ava 2  s  .c  om*/
            components[i].setSize(size);
        }
    }

    public static void setSize(Dimension size, JComponent[] components) {
        for (JComponent component : components) {
            component.setSize(size);
        }
    }

    public static void setSize(Dimension size, List<JComponent> components) {
        for (JComponent component : components) {
            component.setSize(size);
        }
    }
}

Related

  1. getComponentHeight(JComponent component)
  2. getMinimumHeight(JComponent comp)
  3. heighten(JComponent component, int px)
  4. makeEqualHeight(JComponent reference, JComponent... others)
  5. normalizeHeight(JComponent... components)
  6. setComponentHeight(JComponent setme, JComponent getme)
  7. setMaxHeightToPreferred(JComponent component)
  8. setMaximumHeight(JComponent comp, int iHeight)
  9. setMinimumHeight(JComponent component, int height)