Swing
Swing教學首頁
Swing介紹
Swing開發環境安裝
Swing控件
Swing Component類
Swing Container類
Swing JComponent類
Swing JLabel
Swing JButton
Swing JColorChooser
Swing JCheckBox
Swing JRadioButton
Swing JList
Swing JComboBox
Swing JTextField
Swing JTextArea
Swing ImageIcon
Swing JScrollBar
Swing JOptionPane
Swing JFileChooser
Swing JProgressBar
Swing JSlider
Swing JSpinner
Swing事件處理
SWING Event事件類
SWING AWTEvent事件類
SWING ActionEvent事件類
SWING InputEvent事件類
SWING KeyEvent事件類
SWING MouseEvent事件類
SWING WindowEvent事件類
SWING AdjustmentEvent事件處理
SWING ComponentEvent處理類
SWING ContainerEvent事件處理類
SWING MouseMotionEvent事件處理
SWING PaintEvent事件類
Swing事件監聽器
SWING ActionListener接口
SWING ComponentListener接口
Swing ItemListener接口
Swing KeyListener接口
Swing MouseListener Interface
Swing WindowListener接口
Swing AdjustmentListener接口
Swing ContainerListener接口
Swing MouseMotionListener接口
Swing FocusListener接口
Swing事件適配器
Swing FocusAdapter類
Swing KeyAdapter類
Swing MouseAdapter類
Swing WindowAdapter類
Swing MouseMotionAdapter類
Swing Layout佈局
Swing LayoutManager接口
Swing LayoutManager2接口
Swing BorderLayout佈局
Swing CardLayout佈局
Swing FlowLayout佈局類
Swing GridLayout佈局類
Swing GridBagLayout佈局類
Swing GroupLayout佈局類
Swing SpringLayout佈局類
Swing Menu菜單類
Swing JMenuBar類
Swing JMenuItem類
Swing JMenu類
Swing JCheckboxMenuItem類及例子
Swing JRadioButtonMenuItem類及例子
Swing JPopupMenu類及實例
Swing容器
Swing JPanel類及實例
Swing JFrame類和實例
Swing JWindow類及實例

SWING AWTEvent事件類

它是所有 AWTEvent 中事件的根事件類。這個類及其子類取代原來的 java.awt.Event類。 java.awt包中定義這個類。這個類有一個 getID() 方法,該方法可以用來確定事件的類型。

類聲明

以下是聲明 java.awt.AWTEvent類:

public class AWTEvent extends EventObject

字段域

以下是java.awt.AWTEvent 類的字段:

  • static int ACTION_FIRST -- The first number in the range of ids used for action events.

  • static long ACTION_EVENT_MASK -- The event mask for selecting action events.

  • static long ADJUSTMENT_EVENT_MASK -- The event mask for selecting adjustment events.

  • static long COMPONENT_EVENT_MASK -- The event mask for selecting component events.

  • protected boolean consumed -- Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.

  • static long CONTAINER_EVENT_MASK -- The event mask for selecting container events.

  • static long FOCUS_EVENT_MASK -- The event mask for selecting focus events.

  • static long HIERARCHY_BOUNDS_EVENT_MASK -- The event mask for selecting hierarchy bounds events.

  • static long HIERARCHY_EVENT_MASK -- The event mask for selecting hierarchy events.

  • protected int id -- The event's id.

  • static long INPUT_METHOD_EVENT_MASK -- The event mask for selecting input method events.

  • static long INVOCATION_EVENT_MASK -- The event mask for selecting invocation events.

  • static long ITEM_EVENT_MASK -- The event mask for selecting item events.

  • static long KEY_EVENT_MASK -- The event mask for selecting key events.

  • static long MOUSE_EVENT_MASK -- The event mask for selecting mouse events.

  • static long MOUSE_MOTION_EVENT_MASK -- The event mask for selecting mouse motion events.

  • static long MOUSE_WHEEL_EVENT_MASK -- The event mask for selecting mouse wheel events.

  • static long PAINT_EVENT_MASK -- The event mask for selecting paint events.

  • static int RESERVED_ID_MAX -- The maximum value for reserved SWING event IDs.

  • static long TEXT_EVENT_MASK -- The event mask for selecting text events.

  • static long WINDOW_EVENT_MASK -- The event mask for selecting window events.

  • static long WINDOW_FOCUS_EVENT_MASK -- The event mask for selecting window focus events.

  • static long WINDOW_STATE_EVENT_MASK -- The event mask for selecting window state events.

類構造函數

S.N.

構造函數 & 描述

1

AWTEvent(Event event)
Constructs an AWTEvent object from the parameters of a 1.0-style event.

2

AWTEvent(java.lang.Object source, int id)
Constructs an AWTEvent object with the specified source object and type.

類方法

S.N.

方法 & 描述

1

protected void consume()
Consumes this event, if this event can be consumed.

2

int getID()
Returns the event type.

3

protected boolean isConsumed()
Returns whether this event has been consumed.

4

java.lang.String paramString()
Returns a string representing the state of this Event.

5

void setSource(java.lang.Object newSource)
Retargets an event to a new source.

6

java.lang.String toString()
Returns a String representation of this object.

方法繼承

這個類從以下類繼承的方法:

  • java.util.EventObject

  • java.lang.Object