Here you can find the source of newJFrame(Component c, String title, int w, int h)
public static JFrame newJFrame(Component c, String title, int w, int h)
//package com.java2s; //License from project: Apache License import java.awt.BorderLayout; import java.awt.Component; import javax.swing.JFrame; public class Main { public static JFrame newJFrame(Component c, String title, int w, int h) { JFrame f = new JFrame(title); f.getContentPane().add(c, BorderLayout.CENTER); f.setSize(w, h);/*from ww w. j a v a 2s . co m*/ f.pack(); // f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); return f; } }