Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created August 4, 2020 15:44
Show Gist options
  • Save HashRaygoza/024c3c77f996f4e257fd793ca5227d1d to your computer and use it in GitHub Desktop.
Save HashRaygoza/024c3c77f996f4e257fd793ca5227d1d to your computer and use it in GitHub Desktop.
public class EventoProgreso implements PropertyChangeListener {
private final JProgressBar barraProgreso;
public EventoProgreso(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