Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created August 4, 2020 15:51
Show Gist options
  • Save HashRaygoza/3bb71d17f7285199a002905c25e18843 to your computer and use it in GitHub Desktop.
Save HashRaygoza/3bb71d17f7285199a002905c25e18843 to your computer and use it in GitHub Desktop.
public class EventoPropertyListener implements PropertyChangeListener {
private final JProgressBar barraProgreso;
public EventoPropertyListener(JProgressBar barra) {
barraProgreso = barra;
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
// Checamos si la propiedad modificada es progress
if (evt.getPropertyName().compareTo("progress") == 0) {
int progress = (Integer) evt.getNewValue();
System.out.println("********* Progreso: " + progress);
barraProgreso.setValue(progress);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment