Here you can find the source of createFrame()
static JFrame createFrame()
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { static JFrame createFrame() { JFrame frame = new JFrame(); frame.setSize(400, 400);/*from w w w .j ava 2 s .c o m*/ frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.setTitle("Example"); return frame; } }