Java JProgressBar createJProgressBar(String title)

Here you can find the source of createJProgressBar(String title)

Description

Creates the j progress bar.

License

Open Source License

Parameter

Parameter Description
title the title

Return

the j progress bar

Declaration

public static JProgressBar createJProgressBar(String title) 

Method Source Code

//package com.java2s;
/*//from  w  w  w.  jav a2  s.  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 javax.swing.JProgressBar;

public class Main {
    /**
     * Creates the jprogress bar.
     * 
     * @param count the count
     * 
     * @return the j progress bar
     */
    public static JProgressBar createJProgressBar(int count) {
        JProgressBar progressBar = new JProgressBar(0, count);
        progressBar.setValue(0);
        progressBar.setStringPainted(true);
        return progressBar;
    }

    /**
     * Creates the j progress bar.
     * 
     * @param title the title
     * 
     * @return the j progress bar
     */
    public static JProgressBar createJProgressBar(String title) {
        JProgressBar progressBar = new JProgressBar();
        progressBar.setIndeterminate(true);
        progressBar.setStringPainted(true);
        progressBar.setString(title);
        return progressBar;
    }
}

Related

  1. createPanel(String message, JProgressBar progressBar)
  2. createProgressBar()
  3. excutePost(String targetURL, String urlParameters, JProgressBar progress)
  4. generateProgressBarFor(Object... objs)