src/share/classes/java/awt/event/ComponentAdapter.java

Print this page




  27 
  28 /**
  29  * An abstract adapter class for receiving component events.
  30  * The methods in this class are empty. This class exists as
  31  * convenience for creating listener objects.
  32  * <P>
  33  * Extend this class to create a <code>ComponentEvent</code> listener
  34  * and override the methods for the events of interest. (If you implement the
  35  * <code>ComponentListener</code> interface, you have to define all of
  36  * the methods in it. This abstract class defines null methods for them
  37  * all, so you can only have to define methods for events you care about.)
  38  * <P>
  39  * Create a listener object using your class and then register it with a
  40  * component using the component's <code>addComponentListener</code>
  41  * method. When the component's size, location, or visibility
  42  * changes, the relevant method in the listener object is invoked,
  43  * and the <code>ComponentEvent</code> is passed to it.
  44  *
  45  * @see ComponentEvent
  46  * @see ComponentListener
  47  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
  48  *
  49  * @author Carl Quinn
  50  * @since 1.1
  51  */
  52 public abstract class ComponentAdapter implements ComponentListener {
  53     /**
  54      * Invoked when the component's size changes.
  55      */
  56     public void componentResized(ComponentEvent e) {}
  57 
  58     /**
  59      * Invoked when the component's position changes.
  60      */
  61     public void componentMoved(ComponentEvent e) {}
  62 
  63     /**
  64      * Invoked when the component has been made visible.
  65      */
  66     public void componentShown(ComponentEvent e) {}
  67 


  27 
  28 /**
  29  * An abstract adapter class for receiving component events.
  30  * The methods in this class are empty. This class exists as
  31  * convenience for creating listener objects.
  32  * <P>
  33  * Extend this class to create a <code>ComponentEvent</code> listener
  34  * and override the methods for the events of interest. (If you implement the
  35  * <code>ComponentListener</code> interface, you have to define all of
  36  * the methods in it. This abstract class defines null methods for them
  37  * all, so you can only have to define methods for events you care about.)
  38  * <P>
  39  * Create a listener object using your class and then register it with a
  40  * component using the component's <code>addComponentListener</code>
  41  * method. When the component's size, location, or visibility
  42  * changes, the relevant method in the listener object is invoked,
  43  * and the <code>ComponentEvent</code> is passed to it.
  44  *
  45  * @see ComponentEvent
  46  * @see ComponentListener
  47  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
  48  *
  49  * @author Carl Quinn
  50  * @since 1.1
  51  */
  52 public abstract class ComponentAdapter implements ComponentListener {
  53     /**
  54      * Invoked when the component's size changes.
  55      */
  56     public void componentResized(ComponentEvent e) {}
  57 
  58     /**
  59      * Invoked when the component's position changes.
  60      */
  61     public void componentMoved(ComponentEvent e) {}
  62 
  63     /**
  64      * Invoked when the component has been made visible.
  65      */
  66     public void componentShown(ComponentEvent e) {}
  67