ActionEvent e是什么意思? [英] What does ActionEvent e mean?

查看:148
本文介绍了ActionEvent e是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Java,并且真的想对ActionEvent电子性能表的含义和立场有更深入的了解.当我编写代码时,我不仅想吐出有效的行,而且我也不明白.在使用概念之前,我希望对它们有充分的了解.

I am learning Java and would really like to have a deeper understanding of what the ActionEvent e perameter means and stands for. When I code I don't just want to spit out lines that work, but I don't understand. I want to have a full understanding of concepts before I use them.

那么它到底要问什么,这两个部分(ActionEvent和e)是什么意思?

So what specifically is it asking for and what do the two parts(ActionEvent and e) mean?

class ButtonListener implements ActionListener{
        @Override
        public void actionPerformed(ActionEvent e){
    }
}

谢谢.

推荐答案

ActionEvent 是一个类, e 是该类的实例.您可以使用e调用它的方法/属性,在此处

ActionEvent is a class, e is an instance of that class. You can use e to call it's methods/properties, found here

http://docs.oracle.com/javase/7/docs/api/java/awt/event/ActionEvent.html

ActionEvent 只是一种类型,它告诉您对象 e 是什么类型.顺便说一句,例如,您可以将 e 更改为您喜欢的任何内容.事件对象.

ActionEvent is just a type, it informs you what type of object e is. By the way, you can change e to whatever you prefer, for ex. event or object.

ActionEvent事件 ActionEvent对象(请记住,不要与 Object 混淆,其对象的小写字母为"o"), ActionEvent anyVariableName 等...

ActionEvent event, ActionEvent object (remember, not to be confused with Object, its object with lower case "o"), ActionEvent anyVariableName etc...

然后在 actionPerformed()中,您可以调用 event.doSomething();

Then inside actionPerformed() you can call stuff like event.doSomething();

这篇关于ActionEvent e是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆