Java JComponent Width toFixedDim(JComponent c, int width, int height)

Here you can find the source of toFixedDim(JComponent c, int width, int height)

Description

to Fixed Dim

License

Apache License

Declaration

public static void toFixedDim(JComponent c, 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 toFixedDim(JComponent c, int width, int height) {
        Dimension dimension = new Dimension(width, height);
        c.setPreferredSize(dimension);/*from  w ww  .  j a v a 2s. co  m*/
        c.setMaximumSize(dimension);
        c.setMinimumSize(dimension);
    }
}

Related

  1. setPreferredWidth(JComponent component, int width)
  2. setPreferredWidth(JComponent component, int width)
  3. setPreferredWidth(JComponent component, int width)
  4. setPrefferedWidth(JComponent c, int w)
  5. setZeroWidth(JComponent comp)