@Override public void set(Object obj, String fieldName, Integer value) { displayedValue = value; progressBar.repaint(); } }));
@Override public void set(Object obj, String fieldName, Integer value) { displayedValue = value; progressBar.repaint(); } }));
public class ProgressBarPainter implements Runnable{ public JProgressBar jProgressBar1; public void run(){ while(true){ try { Thread.sleep(50); jProgressBar1.repaint(); } catch (InterruptedException ex) { break; } } } }
public void propertyChange(PropertyChangeEvent evt) { if (MeterProgressBar.PROPERTY_STYLE.equals(evt.getPropertyName())) { progressBar.repaint(); } }
JFrame frame = new JFrame("Title"); JPanel panel = new JPanel(); JProgressBar pBar = new JProgressBar(SwingConstants.HORIZONTAL, 0, 100); panel.add(pBar); frame.add(panel); pBar.repaint(); // Will only repaint the progress bar
@Override public void onTimelinePulse(float durationFraction, float timelinePosition) { if ((progressBar != null) && progressBar.isVisible()) progressBar.repaint(); } });
@Override public void onTimelineStateChanged(TimelineState oldState, TimelineState newState, float durationFraction, float timelinePosition) { if ((progressBar != null) && progressBar.isVisible()) progressBar.repaint(); }
public void actionPerformed(ActionEvent ae) { // style1 if (x == 0) delta = +1; else if (x == progressBar.getWidth()) delta = -1; x += delta; progressBar.repaint(); }
@Override @DispatchThread( invocationType = InvocationType.INVOKE_LATER ) public void showProgress( final int progress ) { if( component != null ) { component.setValue( progress ); component.setIndeterminate( false ); component.repaint(); } }
@Override public void onTimelinePulse(float durationFraction, float timelinePosition) { if ((progressBar != null) && progressBar.isVisible()) progressBar.repaint(); } });
public void actionPerformed(ActionEvent ae) { // style1 if (x == 0) delta = +1; else if (x == progressBar.getWidth()) delta = -1; x += delta; progressBar.repaint(); }
public void propertyChange(PropertyChangeEvent e) { if ("selectionForeground".equals(e.getPropertyName()) && (e.getNewValue() instanceof Color)) { progressBar.invalidate(); progressBar.repaint(); } else if ("selectionBackground".equals(e.getPropertyName()) && (e.getNewValue() instanceof Color)) { progressBar.invalidate(); progressBar.repaint(); } } }
@Override @DispatchThread( invocationType = InvocationType.INVOKE_LATER ) public void showProgress( final long inputSize, final long outputSize ) { if( component != null ) { component.setValue( (int) inputSize ); component.setIndeterminate( false ); component.repaint(); } if( secondaryComponent != null ) { secondaryComponent.setValue( (int) outputSize ); secondaryComponent.setIndeterminate( false ); secondaryComponent.repaint(); } }
@Override public void onTimelineStateChanged(TimelineState oldState, TimelineState newState, float durationFraction, float timelinePosition) { if ((progressBar != null) && progressBar.isVisible()) progressBar.repaint(); }
public void actionPerformed(ActionEvent ae) { // style1 if (x == 0) delta = +1; else if (x == progressBar.getWidth()) delta = -1; x += delta; progressBar.repaint(); }
@Override public void repaint(long tm, int x, int y, int width, int height) { long diff = System.currentTimeMillis() - lastProgressPaint; if (isInProgress() && (diff > MIN_REPAINT)) { //System.out.println("repaint()"); if (SwingUtilities.isEventDispatchThread()) { paintImmediately(x, y, width, height); lastProgressPaint = System.currentTimeMillis(); return; } } super.repaint(tm, x, y, width, height); } };
public static void hide() { if (WINDOW == null) { return; } // show a complete bar for a short while WINDOW.bar.setValue(MAX); WINDOW.bar.repaint(); WINDOW.setVisible(false); WINDOW.dispose(); WINDOW = null; if (frame != null) { frame.dispose(); frame = null; } }
public void setValue(final int val) { if (isClosed()) { return; } EventQueue.invokeLater(() -> { downloadProgress.setString(String.format(PRG_STRING_FORMAT, val, downloadProgress.getMaximum())); downloadProgress.setValue(val); downloadProgress.repaint(); }); }
@Override protected void setAnimationIndex(int newValue) { if (paintOutsideClip) { if (getAnimationIndex() == newValue) { return; } super.setAnimationIndex(newValue); progressBar.repaint(); } else { super.setAnimationIndex(newValue); } }
@Override public void done() { if (resources.getModuleOutput().getText().hashCode() != hcout) { resources.getMessagespane().setSelectedIndex(1); } if (resources.getLogs().getText().hashCode() != hclogs) { resources.getMessagespane().setSelectedIndex(0); } resources.getProgressBar().setVisible(false); resources.getProgressBar().invalidate(); resources.getProgressBar().validate(); resources.getProgressBar().repaint(); resources.removeProgressListener(this); resources.getProgressBar().setValue(resources.getProgressBar().getMaximum()); this.resources.getMainFrame().setCursor(null); resources.getMainFrame().setEnabled(true); //setCursor(null); //turn off the wait cursor } public void setCurrentProgress(int progress) {