Here you can find the source of createSimpleFrame(String title, Component content)
Parameter | Description |
---|---|
title | the title of the frame. |
content | the content component to add. |
public static JFrame createSimpleFrame(String title, Component content)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009-2014 Black Rook Software * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html ******************************************************************************/ import java.awt.Component; import javax.swing.JFrame; public class Main { /**//from w w w . ja v a2 s.co m * Creates a simple JFrame that exits on close with a component * in its content pane. * @param title the title of the frame. * @param content the content component to add. * @return a new JFrame. * @since 2.4.0 */ public static JFrame createSimpleFrame(String title, Component content) { JFrame out = new JFrame(title); out.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); out.add(content); out.pack(); return out; } }