Here you can find the source of createWindow(String name, int width, int height, boolean guiOn)
private static JLabel createWindow(String name, int width, int height, boolean guiOn)
//package com.java2s; //License from project: Open Source License import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { private static JLabel createWindow(String name, int width, int height, boolean guiOn) { JFrame imageFrame = new JFrame(name); imageFrame.setSize(width, height); imageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel imagePane = new JLabel(); imagePane.setLayout(new BorderLayout()); imageFrame.setContentPane(imagePane); imageFrame.setVisible(guiOn);//from w w w . j a v a 2 s. co m return imagePane; } }