Here you can find the source of packFrame(JFrame frame)
public static void packFrame(JFrame frame)
//package com.java2s; //License from project: Apache License import javax.swing.*; public class Main { public static void packFrame(JFrame frame) { frame.pack();//w w w . ja va 2 s .c o m } }