< prev index next >
src/java.desktop/share/classes/java/awt/event/ComponentEvent.java
Print this page
*** 45,60 ****
* this class defines the events that indicate changes in
* a component's size, position, or visibility.
* <P>
* This low-level event is generated by a component object (such as a
* List) when the component is moved, resized, rendered invisible, or made
! * visible again. The event is passed to every <code>ComponentListener</code>
! * or <code>ComponentAdapter</code> object which registered to receive such
! * events using the component's <code>addComponentListener</code> method.
! * (<code>ComponentAdapter</code> objects implement the
! * <code>ComponentListener</code> interface.) Each such listener object
! * gets this <code>ComponentEvent</code> when the event occurs.
* <p>
* An unspecified behavior will be caused if the {@code id} parameter
* of any particular {@code ComponentEvent} instance is not
* in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
*
--- 45,60 ----
* this class defines the events that indicate changes in
* a component's size, position, or visibility.
* <P>
* This low-level event is generated by a component object (such as a
* List) when the component is moved, resized, rendered invisible, or made
! * visible again. The event is passed to every {@code ComponentListener}
! * or {@code ComponentAdapter} object which registered to receive such
! * events using the component's {@code addComponentListener} method.
! * ({@code ComponentAdapter} objects implement the
! * {@code ComponentListener} interface.) Each such listener object
! * gets this {@code ComponentEvent} when the event occurs.
* <p>
* An unspecified behavior will be caused if the {@code id} parameter
* of any particular {@code ComponentEvent} instance is not
* in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
*
*** 101,133 ****
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = 8101406823902992965L;
/**
! * Constructs a <code>ComponentEvent</code> object.
* <p> This method throws an
! * <code>IllegalArgumentException</code> if <code>source</code>
! * is <code>null</code>.
*
! * @param source The <code>Component</code> that originated the event
* @param id An integer indicating the type of event.
* For information on allowable values, see
* the class description for {@link ComponentEvent}
! * @throws IllegalArgumentException if <code>source</code> is null
* @see #getComponent()
* @see #getID()
*/
public ComponentEvent(Component source, int id) {
super(source, id);
}
/**
* Returns the originator of the event.
*
! * @return the <code>Component</code> object that originated
! * the event, or <code>null</code> if the object is not a
! * <code>Component</code>.
*/
public Component getComponent() {
return (source instanceof Component) ? (Component)source : null;
}
--- 101,133 ----
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = 8101406823902992965L;
/**
! * Constructs a {@code ComponentEvent} object.
* <p> This method throws an
! * {@code IllegalArgumentException} if {@code source}
! * is {@code null}.
*
! * @param source The {@code Component} that originated the event
* @param id An integer indicating the type of event.
* For information on allowable values, see
* the class description for {@link ComponentEvent}
! * @throws IllegalArgumentException if {@code source} is null
* @see #getComponent()
* @see #getID()
*/
public ComponentEvent(Component source, int id) {
super(source, id);
}
/**
* Returns the originator of the event.
*
! * @return the {@code Component} object that originated
! * the event, or {@code null} if the object is not a
! * {@code Component}.
*/
public Component getComponent() {
return (source instanceof Component) ? (Component)source : null;
}
< prev index next >