Java JFrame newJFrame(Component c, String title, int w, int h)

Here you can find the source of newJFrame(Component c, String title, int w, int h)

Description

new J Frame

License

Apache License

Declaration

public static JFrame newJFrame(Component c, String title, int w, int h) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.BorderLayout;

import java.awt.Component;

import javax.swing.JFrame;

public class Main {
    public static JFrame newJFrame(Component c, String title, int w, int h) {
        JFrame f = new JFrame(title);
        f.getContentPane().add(c, BorderLayout.CENTER);
        f.setSize(w, h);/*from   ww w.  j  a v a 2s  . co  m*/
        f.pack();
        // f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        return f;
    }
}

Related

  1. metalLookAndFeel(JFrame appFrame)
  2. minimize(JFrame frame)
  3. msgBox(JFrame frame, String title, String message)
  4. newDialog(JFrame owner, String title, JPanel content)
  5. newExitActionListener(final JFrame jFrame)
  6. newModalDialog(JFrame owner, String title, JPanel content, JButton... buttons)
  7. optionDialog(String title, String text, String option1, String option2, int defaultOption, JFrame parentFrame)
  8. packFrame(JFrame frame)
  9. packJFrameWindow(final JComponent comp)