Java tutorial
//package com.java2s; //License from project: Open Source License import java.awt.Dimension; import javax.swing.JComponent; public class Main { public static void set3Dimensions(JComponent c, Dimension d) { c.setMinimumSize(d); c.setPreferredSize(d); c.setMaximumSize(d); } }