Java JFrame Create createFrame(String title)

Here you can find the source of createFrame(String title)

Description

creates a new JFrame

License

Open Source License

Parameter

Parameter Description
title title of the frame

Return

the JFrame

Declaration

private static JFrame createFrame(String title) 

Method Source Code

//package com.java2s;
/*//from w w w  .ja v a2 s  . c o  m
 * Copyright (C) 2017 Andreas Maier, Susanne Westphal
 * CONRAD is developed as an Open Source project under the GNU General Public License (GPL).
 */

import javax.swing.JFrame;

public class Main {
    private static int FRAME_ID = 0;

    /**
     * creates a new JFrame 
     * @param title title of the frame
     * @return the JFrame
     */
    private static JFrame createFrame(String title) {
        JFrame frame = new JFrame(title + " (" + FRAME_ID++ + ")");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setSize(500, 400);
        return frame;
    }
}

Related

  1. createApplicationFrame(String title)
  2. createDemoFrame(String title)
  3. createFrame()
  4. createFrame(Container content)
  5. createFrame(String str, int height, int width)
  6. createFrame(String title, JPanel panel)
  7. createIFrame(String name)
  8. createImageFrame(Image image)
  9. createNewFrame(String frameName, int width, int height, boolean visible)