Java JComponent Size setFixedSize(JComponent component, Dimension size)

Here you can find the source of setFixedSize(JComponent component, Dimension size)

Description

set Fixed Size

License

Open Source License

Declaration

public static void setFixedSize(JComponent component, Dimension size) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2001, 2007 Mathew A. Nelson and Robocode contributors
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://robocode.sourceforge.net/license/cpl-v10.html
 *
 * Contributors:/*from   w  ww  .j  a  v  a 2  s. c  o  m*/
 *     Mathew A. Nelson
 *     - Initial API and implementation
 *     Flemming N. Larsen
 *     - Moved window related methods from robocode.util.Utils into this class
 *******************************************************************************/

import java.awt.*;

import javax.swing.JComponent;

public class Main {
    public static void setFixedSize(JComponent component, Dimension size) {
        component.setPreferredSize(size);
        component.setMinimumSize(size);
        component.setMaximumSize(size);
    }
}

Related

  1. setAllSizes(JComponent component, int width, int height)
  2. setComponentSize(int width, int height, JComponent l)
  3. setComponentSize(JComponent comp, int defWidth, int defHeight, Preferences prefs, String name)
  4. setComponentSize(JComponent comp, int width, int height)
  5. setFixedSize(JComponent component, Dimension size)
  6. setFixedSize(JComponent component, int width, int height)
  7. setMaximumSize(Dimension d, JComponent... components)
  8. setMaximumSize(Dimension maxComponentSize, JComponent component)
  9. setMaxPreferredSize(JComponent comp)