Example usage for java.awt Component setMaximumSize

List of usage examples for java.awt Component setMaximumSize

Introduction

In this page you can find the example usage for java.awt Component setMaximumSize.

Prototype

public void setMaximumSize(Dimension maximumSize) 

Source Link

Document

Sets the maximum size of this component to a constant value.

Usage

From source file:org.openmicroscopy.shoola.util.ui.UIUtilities.java

/**
 * Sets the preferred size, minimum and maximum size of the specified 
 * component.//from ww  w .j  a v  a  2 s  .  co m
 * 
 * @param component   The component to handle.
 * @param dim      The dimension to set.
 */
public static void setDefaultSize(Component component, Dimension dim) {
    if (component == null)
        return;
    if (dim == null)
        dim = new Dimension(5, 5);
    component.setPreferredSize(dim);
    component.setMaximumSize(dim);
    component.setMinimumSize(dim);
}