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

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

Description

set Size

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static void setSize(JComponent component, int width, int height) {
        Dimension textPanelSize = new Dimension(width, height);
        component.setSize(textPanelSize);
        component.setPreferredSize(textPanelSize);
        component.setMaximumSize(textPanelSize);
        component.setMinimumSize(textPanelSize);
    }//from   ww w. j a v a2  s.  co m
}

Related

  1. setSize(final Component component, final int width, final int height)
  2. setSize(JComponent c, int w)
  3. setSize(JComponent comp, int w, int h)
  4. setSize(JComponent componenet, Dimension dimension)
  5. setSize(JComponent componenet, Dimension dimension)
  6. setSize(JComponent conponent, int width, int height)
  7. setSizeBasedOnResolution(final JComponent component)
  8. setSizes(JComponent[] components, final Dimension dimension)
  9. setSMPSizes(JComponent comp, Dimension d)