1 7 package javax.swing.event; 8 9 import java.awt.event.*; 10 import java.awt.*; 11 import javax.swing.*; 12 13 29 public class AncestorEvent extends AWTEvent { 30 34 public static final int ANCESTOR_ADDED = 1; 35 39 public static final int ANCESTOR_REMOVED = 2; 40 41 public static final int ANCESTOR_MOVED = 3; 42 43 Container ancestor; 44 Container ancestorParent; 45 46 58 public AncestorEvent(JComponent source, int id, Container ancestor, Container ancestorParent) { 59 super(source, id); 60 this.ancestor = ancestor; 61 this.ancestorParent = ancestorParent; 62 } 63 64 67 public Container getAncestor() { 68 return ancestor; 69 } 70 71 76 public Container getAncestorParent() { 77 return ancestorParent; 78 } 79 80 83 public JComponent getComponent() { 84 return (JComponent)getSource(); 85 } 86 } 87 | Popular Tags |