Java JComponent Size setMaxPreferredSize(JComponent comp)

Here you can find the source of setMaxPreferredSize(JComponent comp)

Description

set Max Preferred Size

License

Open Source License

Declaration

public static void setMaxPreferredSize(JComponent comp) 

Method Source Code

//package com.java2s;
/*//  ww  w  . j  ava  2  s  . c om
 Storybook: Scene-based software for novelists and authors.
 Copyright (C) 2008 - 2012 Martin Mustun
    
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
    
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
    
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.Dimension;

import javax.swing.JComponent;

public class Main {
    public static void setMaxPreferredSize(JComponent comp) {
        comp.setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    }
}

Related

  1. setFixedSize(JComponent component, Dimension size)
  2. setFixedSize(JComponent component, Dimension size)
  3. setFixedSize(JComponent component, int width, int height)
  4. setMaximumSize(Dimension d, JComponent... components)
  5. setMaximumSize(Dimension maxComponentSize, JComponent component)
  6. setMinimumSize(JComponent component, int numChars)
  7. setPreferredSize(JComponent comp, int height, int width)
  8. setSize(Dimension size, JComponent[] components)
  9. setSize(final Component component, final int width, final int height)