Java JFrame createDialogForPanel(JFrame parent, JPanel panel)

Here you can find the source of createDialogForPanel(JFrame parent, JPanel panel)

Description

create Dialog For Panel

License

Apache License

Declaration

public static JDialog createDialogForPanel(JFrame parent, JPanel panel) 

Method Source Code


//package com.java2s;
/*/*from   w w  w . j av  a 2  s. c  o m*/
 * #%L
 * ontop-protege4
 * %%
 * Copyright (C) 2009 - 2013 KRDB Research Centre. Free University of Bozen Bolzano.
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import javax.swing.*;

public class Main {
    public static JDialog createDialogForPanel(JDialog parent, JPanel panel) {
        JDialog newdialog = new JDialog(parent);
        newdialog.getContentPane().add(panel, java.awt.BorderLayout.CENTER);
        newdialog.pack();
        return newdialog;
    }

    public static JDialog createDialogForPanel(JFrame parent, JPanel panel) {
        JDialog newdialog = new JDialog(parent);
        newdialog.getContentPane().add(panel, java.awt.BorderLayout.CENTER);
        newdialog.pack();
        return newdialog;
    }
}

Related

  1. closeOnKeyStroke(JFrame frame, KeyStroke keyStroke)
  2. closeWindow(final JFrame frame)
  3. configToApplicationFrame(JFrame frm)
  4. confirm(JFrame parent, String query, int type)
  5. createConfirmOnExitAdapter(final JFrame frame, final String title, final String message)
  6. createPackedJFrame( java.awt.Component content, String title, int closeOperation)
  7. decorateFrame(JFrame frame, JMenuBar menuBar)
  8. deleteFile(String filepath, JFrame parent)
  9. dialogYesNo(JFrame frame, String title, String message, Object[] options)