Java JComponent Size forceSize(JComponent component, int width, int height)

Here you can find the source of forceSize(JComponent component, int width, int height)

Description

force Size

License

Apache License

Declaration

public static void forceSize(JComponent component, int width, int height) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Dimension;

import javax.swing.JComponent;

public class Main {
    public static void forceSize(JComponent component, int width, int height) {
        Dimension d = new Dimension(width, height);
        component.setMinimumSize(d);//w  w w.ja  va2s  .  com
        component.setMaximumSize(d);
        component.setPreferredSize(d);
    }
}

Related

  1. evenSizes(JComponent[] components)
  2. findCenterBounds(Dimension componentSize)
  3. fixSize(JComponent c, Dimension d)
  4. fixSize(JComponent... items)
  5. fixSize(T comp, int width)
  6. freezeSize(JComponent c, Dimension s)
  7. getCentralLocation(Component sourceComp, Component comp, Dimension size)
  8. getComponentOfSameSize(final JComponent c)
  9. getLocalScreenSize(Component invoker)