Here you can find the source of setMinMaxSizeFrame(JFrame frame)
public static void setMinMaxSizeFrame(JFrame frame)
//package com.java2s; //License from project: Apache License import javax.swing.*; import java.awt.*; public class Main { public static void setMinMaxSizeFrame(JFrame frame) { setMinSizeFrame(frame);// w w w . ja va 2s . c om setMaxSizeFrame(frame); frame.setResizable(false); } public static void setMinSizeFrame(JFrame frame) { Dimension dimension = frame.getSize(); frame.pack(); frame.setMinimumSize(frame.getSize()); frame.setSize(dimension); } public static void setMaxSizeFrame(JFrame frame) { frame.pack(); frame.setMaximumSize(frame.getSize()); } }