1 package net.suberic.pooka.gui; 2 3 import net.suberic.pooka.event.*; 4 import javax.swing.JProgressBar ; 5 6 10 11 public class LoadMessageTracker extends JProgressBar implements MessageLoadedListener { 12 13 private int initialValue; 14 15 public LoadMessageTracker(int newInitialValue) { 16 super(); 17 initialValue=newInitialValue; 18 } 19 20 public LoadMessageTracker(int newInitialValue, int newMin, int newMax) { 21 super(newMin, newMax); 22 initialValue=newInitialValue; 23 } 24 25 28 public void handleMessageLoaded(MessageLoadedEvent e) { 29 if (e.getNumMessages() != this.getMaximum()) 30 this.setMaximum(e.getNumMessages()); 31 setValue(this.getValue() + e.getLoadedMessageCount()); 32 } 36 } 37 38 | Popular Tags |