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

Print this page




  40  * the event occurs.
  41  * <p>
  42  * There are two levels of focus events: permanent and temporary. Permanent
  43  * focus change events occur when focus is directly moved from one Component to
  44  * another, such as through a call to requestFocus() or as the user uses the
  45  * TAB key to traverse Components. Temporary focus change events occur when
  46  * focus is temporarily lost for a Component as the indirect result of another
  47  * operation, such as Window deactivation or a Scrollbar drag. In this case,
  48  * the original focus state will automatically be restored once that operation
  49  * is finished, or, for the case of Window deactivation, when the Window is
  50  * reactivated. Both permanent and temporary focus events are delivered using
  51  * the FOCUS_GAINED and FOCUS_LOST event ids; the level may be distinguished in
  52  * the event using the isTemporary() method.
  53  * <p>
  54  * An unspecified behavior will be caused if the {@code id} parameter
  55  * of any particular {@code FocusEvent} instance is not
  56  * in the range from {@code FOCUS_FIRST} to {@code FOCUS_LAST}.
  57  *
  58  * @see FocusAdapter
  59  * @see FocusListener
  60  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
  61  *
  62  * @author Carl Quinn
  63  * @author Amy Fowler
  64  * @since 1.1
  65  */
  66 public class FocusEvent extends ComponentEvent {
  67 
  68     /**
  69      * The first number in the range of ids used for focus events.
  70      */
  71     public static final int FOCUS_FIRST         = 1004;
  72 
  73     /**
  74      * The last number in the range of ids used for focus events.
  75      */
  76     public static final int FOCUS_LAST          = 1005;
  77 
  78     /**
  79      * This event indicates that the Component is now the focus owner.
  80      */




  40  * the event occurs.
  41  * <p>
  42  * There are two levels of focus events: permanent and temporary. Permanent
  43  * focus change events occur when focus is directly moved from one Component to
  44  * another, such as through a call to requestFocus() or as the user uses the
  45  * TAB key to traverse Components. Temporary focus change events occur when
  46  * focus is temporarily lost for a Component as the indirect result of another
  47  * operation, such as Window deactivation or a Scrollbar drag. In this case,
  48  * the original focus state will automatically be restored once that operation
  49  * is finished, or, for the case of Window deactivation, when the Window is
  50  * reactivated. Both permanent and temporary focus events are delivered using
  51  * the FOCUS_GAINED and FOCUS_LOST event ids; the level may be distinguished in
  52  * the event using the isTemporary() method.
  53  * <p>
  54  * An unspecified behavior will be caused if the {@code id} parameter
  55  * of any particular {@code FocusEvent} instance is not
  56  * in the range from {@code FOCUS_FIRST} to {@code FOCUS_LAST}.
  57  *
  58  * @see FocusAdapter
  59  * @see FocusListener
  60  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
  61  *
  62  * @author Carl Quinn
  63  * @author Amy Fowler
  64  * @since 1.1
  65  */
  66 public class FocusEvent extends ComponentEvent {
  67 
  68     /**
  69      * The first number in the range of ids used for focus events.
  70      */
  71     public static final int FOCUS_FIRST         = 1004;
  72 
  73     /**
  74      * The last number in the range of ids used for focus events.
  75      */
  76     public static final int FOCUS_LAST          = 1005;
  77 
  78     /**
  79      * This event indicates that the Component is now the focus owner.
  80      */