List of utility methods to do JProgressBar
JProgressBar | createJProgressBar(String title) Creates the j progress bar. JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); progressBar.setStringPainted(true); progressBar.setString(title); return progressBar; |
JPanel | createPanel(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; |
JProgressBar | createProgressBar() create Progress Bar JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); progressBar.setIndeterminate(false); progressBar.setMaximum(100); progressBar.setValue(100); return progressBar; |
String | excutePost(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"); ... |
JProgressBar | generateProgressBarFor(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]) ... |
void | incProgressBar(JProgressBar jpb) Increments the progress bar. jpb.setValue(jpb.getValue() + 1); jpb.repaint(); |
void | printProgress(JProgressBar prBar, int progressValue) print Progress if (prBar != null) prBar.setValue(progressValue); else { System.out.print("\rProgress: " + progressValue + "%"); if (progressValue == 100) System.out.println(); |
void | SetProgressBar(JProgressBar jpb) Set Progress Bar jpb.setValue(0);
jpb.setIndeterminate(true);
jpb.setOpaque(true);
jpb.setStringPainted(true);
jpb.setString("Pre-processing Image");
|
JProgressBar | showProgressBar(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); ... |
void | updateProgressBase(JProgressBar progressBar, int done, int maximum) update Progress Base if (progressBar != null) {
progressBar.setValue(done);
progressBar.setMaximum(maximum);
progressBar.setStringPainted(true);
progressBar.repaint();
|