首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 通过简单的java事件模型的诠释

通过简单的java事件模型的诠释

  • 资源大小:139.97 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: java 简单 模型 通过 事件

资 源 简 介

neoevents is a dead-simple annotation-based swing-compliant java-event framework. ``` @actionPerformed private void onClick() { frame.setTitle("Hello World "+ new Date()); } protected void initComponents() { JButton button = new JButton("Click me!!!"); button.addActionListener(new ActionListener(this)); frame.getContentPane().add(button); } ``` note that : new ActionListener(this) stands for new net.ericaro.neoevents.java.awt.event.ActionListener(this). It is a simple POJO class that forwards every "actionPerformed" call to every method of this annotated with @actionPerformed. Every Listener in the whole java, and javax packages are mapped to net.ericaro.neoevents.xxx Before neoevents you would have done something like : ``` java.awt.event.ActionListener listener = new java.awt.event.ActionList

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP