Java JComponent Size setZeroMinimumSize(Component component)

Here you can find the source of setZeroMinimumSize(Component component)

Description

Sets the component to a minimum size of zero to allow split panes and layout managers from shrinking the components

License

Open Source License

Declaration

public static void setZeroMinimumSize(Component component) 

Method Source Code


//package com.java2s;
/*/*from w  w  w . j av  a 2 s . c om*/
 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
 * 
 * This software is open source. 
 * See the bottom of this file for the licence.
 * 
 * $Id: SwingUtils.java,v 1.1.1.1 2001/05/22 08:13:01 jstrachan Exp $
 */

import javax.swing.*;
import java.awt.*;
import javax.swing.*;

public class Main {
    public static final Dimension ZERO_DIMENSION = new Dimension(0, 0);

    /** Sets the component to a minimum size of zero to allow split panes
      * and layout managers from shrinking the components
      */
    public static void setZeroMinimumSize(Component component) {
        if (component instanceof JComponent) {
            ((JComponent) component).setMinimumSize(ZERO_DIMENSION);
        }
    }
}

Related

  1. setSize(JComponent conponent, int width, int height)
  2. setSizeBasedOnResolution(final JComponent component)
  3. setSizes(JComponent[] components, final Dimension dimension)
  4. setSMPSizes(JComponent comp, Dimension d)
  5. setUnlimitedSize(JComponent component)
  6. show(final JComponent component, final String windowTitle, final Dimension size)
  7. showComponent(JComponent component, Dimension size)
  8. showGUI(final JComponent newContentPane, final String windowTitle, final Dimension size)
  9. showStaticPage(final URI uri, final Dimension size, final Point location)