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 InputEvent事件類

InputEvent類是所有組件級別輸入事件的根事件類。輸入事件被傳遞到處理前的監聽器通常由他們起源的源。這讓監聽器和組件的子類「消費」事件源不會使他們以默認方式處理。例如,一個按鈕組件,將防止消耗mousePressed事件按鈕被激活。

類聲明

以下是聲明 java.awt.event.InputEvent類:

public abstract class InputEvent extends ComponentEvent

字段域

以下爲java.awt.event.InputEvent類字段:

  • static int ALT_DOWN_MASK -- The Alt key extended modifier constant.

  • static int ALT_GRAPH_DOWN_MASK -- The AltGraph key extended modifier constant.

  • static int ALT_GRAPH_MASK -- The AltGraph key modifier constant.

  • static int ALT_MASK -- The Alt key modifier constant.

  • static int BUTTON1_DOWN_MASK -- The Mouse Button1 extended modifier constant.

  • static int BUTTON1_MASK -- The Mouse Button1 modifier constant.

  • static int BUTTON2_DOWN_MASK -- The Mouse Button2 extended modifier constant.

  • static int BUTTON2_MASK -- The Mouse Button2 modifier constant.

  • static int BUTTON3_DOWN_MASK -- The Mouse Button3 extended modifier constant.

  • static int BUTTON3_MASK --The Mouse Button3 modifier constant.

  • static int CTRL_DOWN_MASK -- The Control key extended modifier constant.

  • static int CTRL_MASK -- The Control key modifier constant.

  • static int META_DOWN_MASK -- The Meta key extended modifier constant.

  • static int META_MASK -- The Meta key modifier constant.

  • static int SHIFT_DOWN_MASK -- The Shift key extended modifier constant.

  • static int SHIFT_MASK -- The Shift key modifier constant.

類方法

S.N.

方法 & 描述

1

void consume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.

2

int getModifiers()
Returns the modifier mask for this event.

3

int getModifiersEx()
Returns the extended modifier mask for this event.

4

static String getModifiersExText(int modifiers)
Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".

5

long getWhen()
Returns the timestamp of when this event occurred.

6

boolean isAltDown()
Returns whether or not the Alt modifier is down on this event.

7

boolean isAltGraphDown()
Returns whether or not the AltGraph modifier is down on this event.

8

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

9

boolean isControlDown()
Returns whether or not the Control modifier is down on this event.

10

boolean isMetaDown()
Returns whether or not the Meta modifier is down on this event.

11

boolean isShiftDown()
Returns whether or not the Shift modifier is down on this event.

方法繼承

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

  • java.awt.event.ComponentEvent

  • java.awt.AWTEvent

  • java.util.EventObject

  • java.lang.Object