Java JComponent Width setMinimumWidth(JComponent component, int width)

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

Description

set Minimum Width

License

Open Source License

Declaration

public static void setMinimumWidth(JComponent component, int width) 

Method Source Code


//package com.java2s;
/*/*  ww w.  ja va  2s.co  m*/
(C) 2007 Stefan Reich (jazz@drjava.de)
This source file is part of Project Prophecy.
For up-to-date information, see http://www.drjava.de/prophecy
    
This source file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
*/

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

public class Main {
    public static void setMinimumWidth(JComponent component, int width) {
        component.setMinimumSize(new Dimension(width, component.getMinimumSize().height));
    }
}

Related

  1. setComponentWidth(final JComponent component, final int width)
  2. setMaximumWidth(final JComponent component, final int width)
  3. setMaximumWidth(JComponent component, int width)
  4. setMaxWidth(JComponent comp, int width)
  5. setMinimumWidth(JComponent component, int minWidth)
  6. setPreferredWidth(final JComponent component, final int width)
  7. setPreferredWidth(final JComponent component, final int width)
  8. setPreferredWidth(int width, JComponent... components)
  9. setPreferredWidth(JComponent comp, int iWidth)