List of usage examples for java.awt.event ActionEvent ACTION_LAST
int ACTION_LAST
To view the source code for java.awt.event ActionEvent ACTION_LAST.
Click Source Link
From source file:Main.java
public KeyTextComponent() { setBackground(Color.CYAN);/*from ww w . j a v a 2s .c o m*/ KeyListener internalKeyListener = new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (actionListenerList != null) { int keyCode = keyEvent.getKeyCode(); String keyText = KeyEvent.getKeyText(keyCode); ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_LAST, keyText); fireActionPerformed(actionEvent); } } }; MouseListener internalMouseListener = new MouseAdapter() { public void mousePressed(MouseEvent mouseEvent) { requestFocusInWindow(); } }; addKeyListener(internalKeyListener); addMouseListener(internalMouseListener); }