Here you can find the source of createNewFrame(String frameName, int width, int height, boolean visible)
public static JFrame createNewFrame(String frameName, int width, int height, boolean visible)
//package com.java2s; //License from project: Open Source License import javax.swing.JFrame; public class Main { public static JFrame createNewFrame(String frameName, int width, int height, boolean visible) { JFrame frame = new JFrame(frameName); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(width, height);/*www. jav a 2 s. c om*/ if (visible == true) { frame.pack(); } frame.setVisible(visible); return frame; } }