Here you can find the source of adjustNarrowField(final JComponent component, final int width)
Parameter | Description |
---|---|
component | a parameter |
width | a parameter |
public static void adjustNarrowField(final JComponent component, final int width)
//package com.java2s; // it under the terms of the GNU General Public License as published by import javax.swing.*; import java.awt.*; public class Main { public static final int HEIGHT_ROW = 27; private static final int WIDTH_NARROW_FIELD = 100; /*********************************************************************************************** * Adjust the sizes of the specified component to be a narrower field. */*from www. j a va2 s . c o m*/ * @param component */ public static void adjustNarrowField(final JComponent component) { adjustNarrowField(component, WIDTH_NARROW_FIELD); } /*********************************************************************************************** * Adjust the sizes of the specified component to be a narrower field. * * @param component * @param width */ public static void adjustNarrowField(final JComponent component, final int width) { component.setMaximumSize(new Dimension(width, HEIGHT_ROW)); component.setPreferredSize(new Dimension(width, HEIGHT_ROW)); } }