Listeners that needed when we want to deal with some event,
addWindowListener(new WindowAdapter())
public abstract class WindowAdapter
implements WindowListener, WindowStateListener, WindowFocusListener
{
/**
* Invoked when a window has been opened.
*/
public void windowOpened(WindowEvent e) {}
/**
* Invoked when a window is in the process of being closed.
* The close operation can be overridden at this point.
*/
public void windowClosing(WindowEvent e) {}
/**
* Invoked when a window has been closed.
*/
public void windowClosed(WindowEvent e) {}
/**
* Invoked when a window is iconified.
*/
public void windowIconified(WindowEvent e) {}
/**
* Invoked when a window is de-iconified.
*/
public void windowDeiconified(WindowEvent e) {}
/**
* Invoked when a window is activated.
*/
public void windowActivated(WindowEvent e) {}
/**
* Invoked when a window is de-activated.
*/
public void windowDeactivated(WindowEvent e) {}
/**
* Invoked when a window state is changed.
* @since 1.4
*/
public void windowStateChanged(WindowEvent e) {}
/**
* Invoked when the Window is set to be the focused Window, which means
* that the Window, or one of its subcomponents, will receive keyboard
* events.
*
* @since 1.4
*/
public void windowGainedFocus(WindowEvent e) {}
/**
* Invoked when the Window is no longer the focused Window, which means
* that keyboard events will no longer be delivered to the Window or any of
* its subcomponents.
*
* @since 1.4
*/
public void windowLostFocus(WindowEvent e) {}
}
addItemListener(new ItemListener())
public interface ItemListener extends EventListener {
/**
* Invoked when an item has been selected or deselected by the user.
* The code written for this method performs the operations
* that need to occur when an item is selected (or deselected).
*/
void itemStateChanged(ItemEvent e);
}
addKeyListener(new KeyAdapter())
public abstract class KeyAdapter implements KeyListener {
/**
* Invoked when a key has been typed.
* This event occurs when a key press is followed by a key release.
*/
public void keyTyped(KeyEvent e) {}
/**
* Invoked when a key has been pressed.
*/
public void keyPressed(KeyEvent e) {}
/**
* Invoked when a key has been released.
*/
public void keyReleased(KeyEvent e) {}
}
addFocusListener(new FocusListener())
public interface FocusListener extends EventListener {
/**
* Invoked when a component gains the keyboard focus.
*/
public void focusGained(FocusEvent e);
/**
* Invoked when a component loses the keyboard focus.
*/
public void focusLost(FocusEvent e);
}
addActionListener(new ActionListener())
public interface ActionListener extends EventListener {
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e);
}
addMouseDoubleClickListener(new MouseAdapter())
public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
/**
* {@inheritDoc}
*/
public void mouseClicked(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mousePressed(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseReleased(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseEntered(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseExited(MouseEvent e) {}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseWheelMoved(MouseWheelEvent e){}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseDragged(MouseEvent e){}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseMoved(MouseEvent e){}
}
分享到:
相关推荐
spring boot 开发 servlet filters listeners
主要介绍了Vue组件通信$attrs、$listeners实现原理解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
听众 测试如何在 Swing 中使用各种侦听器
Passive Event Listeners - 被动事件监听器在写webapp页面的时候,Chrome 提醒 [Violat
:chequered_flag: React最终形式的听众 :chequered_flag: React Final Form Listeners是一组有用的组件的集合,这些组件用于侦听表单中的字段 。安装npm install --save react-final-form-listeners react-final-...
主要介绍了Vue为什么要谨慎使用$attrs与$listeners,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
cd laravel-events-listeners 设定档 # Install dependencies composer install # Create file .env cp .env.example .env # Create migrations (tables and Seeders) php artisan migrate --seed # Create Server ...
前端开源库-throw-max-listeners-error引发最大侦听器错误,超过最大EventEmitter侦听器数时引发错误
IEC 61162-1-2016 Single talker and multiple listeners最新英文版.pdf
主要介绍了Vue 父子组件数据传递的四种方式( inheritAttrs + $attrs + $listeners),需要的朋友可以参考下
npm install --save react-native-event-listeners 要么 yarn add react-native-event-listeners 使用范例 提示:事件侦听器还可以跨不同文件工作。 您只需要将EventRegister导入每个需要发送或接收
主要给大家介绍了关于Vue v2.4中新增的$attrs及$listeners属性的使用方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。
主要介绍了Vue2.4+新增属性.sync、$attrs、$listeners的具体使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
天气预报 使用简单天气预报Java应用 开放天气API API是应用程序编程接口的缩写。 基本上,它允许两个或多个程序之间的交互。 通常,Web编程将API用于其端点,因此其他程序可能会使用/向/从端点... | |__listeners |
利用jmeter工具里的junit,java,http方式进行性能测试
•More podcast listeners are becoming heavy usersof the medium. There is double digit year over year growth among the heaviest podcast listeners. •Time spent with podcasts is growing across the board...
adapter-kit.zip,androidadapter工具包的一组有用适配器是android的一组有用适配器。
event_listeners