Java JComponent Size getMaxSize(JComponent[] components)

Here you can find the source of getMaxSize(JComponent[] components)

Description

get Max Size

License

Open Source License

Declaration

public static Dimension getMaxSize(JComponent[] components) 

Method Source Code

//package com.java2s;

import java.awt.Dimension;

import javax.swing.JComponent;

public class Main {
    public static Dimension getMaxSize(JComponent[] components) {
        int width = 0;
        int height = 0;

        for (int i = 0; i < components.length; i++) {
            Dimension size = components[i].getPreferredSize();
            width = Math.max(width, size.width);
            height = Math.max(height, size.height);
        }//from w  ww.  j  a va2  s. c  o m

        return new Dimension(width, height);
    }
}

Related

  1. forceSize(JComponent component, int width, int height)
  2. freezeSize(JComponent c, Dimension s)
  3. getCentralLocation(Component sourceComp, Component comp, Dimension size)
  4. getComponentOfSameSize(final JComponent c)
  5. getLocalScreenSize(Component invoker)
  6. getOptimalScreenSize(Container container, Dimension currentDim)
  7. getPreferredSize(JComponent component, int width)
  8. getPreferredSize(String html, boolean width, int prefSize)
  9. getPreferredSize(Window window)