Class AWTEvent in Java

0
262
Spread the love
  • 54
  • 5
  • 3
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
    64
    Shares

AWTEvent in Java:

AWTEvent is an abstract class that acts as a superclass of all events(AWT). As AWTEvent deals with Events, it has a source object which can be fetched using the getSource() method. It also provides an id for every event which can be fetched by the getID() method.
Subclasses of AWTEvent class defines various constants available in this class as a field type.

The abstract class AWTEvent is defined as:


public abstract class java.awt.AWTEvent extends 
                      java.util.EventObject{
//Constructors
public AWTEvent(Event event);
public AWTEvent(Object source, int id);
// Constants
public static final long ACTION_EVENT_MASK;
public static final long ADJUSTMENT_EVENT_MASK;
public static final long COMPONENT_EVENT_MASK;
public static final long CONTAINER_EVENT_MASK;
public static final long FOCUS_EVENT_MASK;
public static final long ITEM_EVENT_MASK;
public static final long KEY_EVENT_MASK;
public static final long MOUSE_EVENT_MASK;
public static final long MOUSE_MOTION_EVENT_MASK;
public static final int RESERVED_ID_MAX;
public static final long TEXT_EVENT_MASK;
public static final long WINDOW_EVENT_MASK;
//member variables
protected boolean consumed;
protected int id;
//methods
public int getID();
public String paramString();
public String toString();
protected void consume();
protected boolean isConsumed();
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 54
  • 5
  • 3
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
    64
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here