1 7 8 package javax.swing.event; 9 10 import java.util.EventObject ; 11 12 13 28 public class ListDataEvent extends EventObject 29 { 30 31 public static final int CONTENTS_CHANGED = 0; 32 33 public static final int INTERVAL_ADDED = 1; 34 35 public static final int INTERVAL_REMOVED = 2; 36 37 private int type; 38 private int index0; 39 private int index1; 40 41 51 public int getType() { return type; } 52 53 60 public int getIndex0() { return index0; } 61 67 public int getIndex1() { return index1; } 68 69 80 public ListDataEvent(Object source, int type, int index0, int index1) { 81 super(source); 82 this.type = type; 83 this.index0 = Math.min(index0, index1); 84 this.index1 = Math.max(index0, index1); 85 } 86 87 97 public String toString() { 98 return getClass().getName() + 99 "[type=" + type + 100 ",index0=" + index0 + 101 ",index1=" + index1 + "]"; 102 } 103 } 104 105 106 107 | Popular Tags |