Here you can find the source of setComponent3Width(JComponent c, int width)
public static void setComponent3Width(JComponent c, int width)
//package com.java2s; //License from project: Open Source License import java.awt.Dimension; import javax.swing.JComponent; public class Main { public static void setComponent3Width(JComponent c, int width) { Dimension d = new Dimension(width, c.getPreferredSize().height); set3Dimensions(c, d);//from ww w .j a v a2 s .c om } public static void set3Dimensions(JComponent c, Dimension d) { c.setMinimumSize(d); c.setPreferredSize(d); c.setMaximumSize(d); } }