Java JFrame Parent createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar)

Here you can find the source of createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar)

Description

Creates the progress dialog.

License

Open Source License

Parameter

Parameter Description
parentFrame the parent frame
title the title
progressBar the progress bar

Return

the j dialog

Declaration

public static JDialog createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar) 

Method Source Code


//package com.java2s;
/*//from w  w w .  ja  va2s . co m
 *-------------------
 * The ProgressBarUtil.java is part of ASH Viewer
 *-------------------
 * 
 * ASH Viewer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ASH Viewer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ASH Viewer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Copyright (c) 2009, Alex Kardapolov, All rights reserved.
 *
 */

import java.awt.Frame;
import javax.swing.JDialog;
import javax.swing.JProgressBar;

public class Main {
    /**
     * Creates the progress dialog.
     * 
     * @param parentFrame the parent frame
     * @param title the title
     * @param progressBar the progress bar
     * 
     * @return the j dialog
     */
    public static JDialog createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar) {
        JDialog dialog = new JDialog(parentFrame, true);
        dialog.setContentPane(progressBar);
        dialog.setTitle(title);
        char c = '\u012C';
        byte byte0 = 50;
        int x = (parentFrame.getX() + parentFrame.getWidth() / 2) - 150;
        int y = (parentFrame.getY() + parentFrame.getHeight() / 2) - 25;
        dialog.setBounds(x, y, 300, 50);
        return dialog;
    }
}

Related

  1. AllPlatformSaveAs(Frame parentFrame, String dialogTitle, String directory, final String fileExtension, String fractionFileName, FileFilter nonMacFileFilter)
  2. buildParentFrame(Object inp)
  3. centreOverFrame(JInternalFrame win, JInternalFrame parent)
  4. closeFrameWhenEscapePressed(final JRootPane panel, final ActionListener actListener)
  5. createExceptionDialog(Frame parent, String title, Throwable error)
  6. enableAllComponents(final boolean enable, final Frame parent)
  7. enableAllComponentsExcept(final boolean enable, final Frame parent, final Component... components)
  8. ensureVisibilityAtParent(final JInternalFrame frame)
  9. execLoop(JComponent editor, Frame parent, boolean modal, int w, int h)