Java JFrame Create createAndShowDemoFrame(final String demoTitle, final Container demoContainer)

Here you can find the source of createAndShowDemoFrame(final String demoTitle, final Container demoContainer)

Description

create And Show Demo Frame

License

Open Source License

Declaration

public static void createAndShowDemoFrame(final String demoTitle, final Container demoContainer) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class Main {
    public static void createAndShowDemoFrame(final String demoTitle, final Container demoContainer) {
        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame(demoTitle);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setContentPane(demoContainer);
            frame.pack();//from  w  w w  . j a  v a2s  .c  om
            frame.setVisible(true);
        });
    }
}

Related

  1. createApplicationFrame(String title)
  2. createDemoFrame(String title)
  3. createFrame()
  4. createFrame(Container content)