Java Utililty Methods JProgressBar

List of utility methods to do JProgressBar

Description

The list of methods to do JProgressBar are organized into topic(s).

Method

JProgressBarcreateJProgressBar(String title)
Creates the j progress bar.
JProgressBar progressBar = new JProgressBar();
progressBar.setIndeterminate(true);
progressBar.setStringPainted(true);
progressBar.setString(title);
return progressBar;
JPanelcreatePanel(String message, JProgressBar progressBar)
create Panel
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(new JLabel(message));
panel.add(progressBar);
return panel;
JProgressBarcreateProgressBar()
create Progress Bar
JProgressBar progressBar = new JProgressBar();
progressBar.setIndeterminate(true);
progressBar.setIndeterminate(false);
progressBar.setMaximum(100);
progressBar.setValue(100);
return progressBar;
StringexcutePost(String targetURL, String urlParameters, JProgressBar progress)
excute Post
HttpURLConnection connection = null;
if (targetURL.startsWith("https://login.minecraft.net")) {
    targetURL = "http://session.minecraft.net/game/getversion.jsp";
try {
    URL url = new URL(targetURL);
    connection = (HttpURLConnection) url.openConnection();
    connection.setRequestMethod("POST");
...
JProgressBargenerateProgressBarFor(Object... objs)
generate Progress Bar For
Container c = search(objs, Container.class);
String[] name_value = search(objs, String[].class);
BoundedRangeModel model = search(objs, BoundedRangeModel.class);
Integer[] params = search(objs, Integer[].class);
ProgressBarUI ui = search(objs, ProgressBarUI.class);
JProgressBar pbar = (params == null || params.length > 3 || params.length < 1) ? new JProgressBar()
        : (params.length == 1 ? new JProgressBar(params[0])
                : (params.length == 2 ? new JProgressBar(params[0], params[1])
...
voidincProgressBar(JProgressBar jpb)
Increments the progress bar.
jpb.setValue(jpb.getValue() + 1);
jpb.repaint();
voidprintProgress(JProgressBar prBar, int progressValue)
print Progress
if (prBar != null)
    prBar.setValue(progressValue);
else {
    System.out.print("\rProgress: " + progressValue + "%");
    if (progressValue == 100)
        System.out.println();
voidSetProgressBar(JProgressBar jpb)
Set Progress Bar
jpb.setValue(0);
jpb.setIndeterminate(true);
jpb.setOpaque(true);
jpb.setStringPainted(true);
jpb.setString("Pre-processing Image");
JProgressBarshowProgressBar(String message, int steps)
Shows the progress bar.
JProgressBar jpb = new JProgressBar();
jpb.setMinimum(0);
jpb.setMaximum(steps);
JWindow pBarWin = new JWindow();
JLabel jl = new JLabel(message);
JPanel jp = new JPanel();
jp.setBorder(new SoftBevelBorder(SoftBevelBorder.RAISED));
jp.add(jl);
...
voidupdateProgressBase(JProgressBar progressBar, int done, int maximum)
update Progress Base
if (progressBar != null) {
    progressBar.setValue(done);
    progressBar.setMaximum(maximum);
    progressBar.setStringPainted(true);
    progressBar.repaint();