Java JComponent Size setSize(JComponent componenet, Dimension dimension)

Here you can find the source of setSize(JComponent componenet, Dimension dimension)

Description

setButtonOk

License

Open Source License

Parameter

Parameter Description
anButton JButton

Declaration



public static void setSize(JComponent componenet, Dimension dimension) 

Method Source Code

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

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

public class Main {
    /**//from   w  w  w . ja  v  a  2s . c  om
     * setButtonOk
     *
     * @param anButton JButton
     */
    /*public static void setButtonDelete(JButton anButton) {
      anButton.setText(BUTTON_DELETE);
    }*/

    public static void setSize(JComponent componenet, Dimension dimension) {
        componenet.setMinimumSize(dimension);
        componenet.setMaximumSize(dimension);
        componenet.setPreferredSize(dimension);
    }
}

Related

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