JAR Archives: Pack Progress Monitor : ProgressMonitor « Swing « Java Tutorial






import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.jar.Pack200;

import javax.swing.ProgressMonitor;

public class PackProgressMonitor extends ProgressMonitor implements PropertyChangeListener {

  public PackProgressMonitor(Component parent) {
    super(parent, null, "Packing", -1, 100);
  }

  public void propertyChange(PropertyChangeEvent event) {
    if (event.getPropertyName().equals(Pack200.Packer.PROGRESS)) {
      String newValue = (String) event.getNewValue();
      int value = Integer.parseInt(newValue);
      this.setProgress(value);
    }
  }
}








14.110.ProgressMonitor
14.110.1.ProgressMonitor ClassProgressMonitor Class
14.110.2.Creating a Progress Monitor Dialog
14.110.3.Create a ProgressMonitor toolbar
14.110.4.Implement ProgressMonitor toolbar with a file to monitor
14.110.5.Customizing a ProgressMonitor Look and Feel
14.110.6.Setting the Popup Delay of a Progress Monitor Dialog
14.110.7.JAR Archives: Pack Progress Monitor