Here you can find the source of createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar)
Parameter | Description |
---|---|
parentFrame | the parent frame |
title | the title |
progressBar | the progress bar |
public static JDialog createProgressDialog(Frame parentFrame, String title, JProgressBar progressBar)
//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; } }