【问题标题】:Cannot resolve the "e" in e.getKeyCode();无法解析 e.getKeyCode() 中的“e”;
【发布时间】:2018-08-08 20:51:44
【问题描述】:

我正在尝试实现一个按键事件,但 eclipse 无法解析 e.getKeyCode() 中的“e”;

我在这里错过了什么?

Error

【问题讨论】:

  • 您的意思是访问arg0 而不是ee 似乎没有在任何地方定义。

标签: keyevent


【解决方案1】:

您的代码中没有定义e。您的方法签名为:

public void keyPressed(KeyEvent arg0)

arg0 更改为e,反之亦然。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 1970-01-01
    • 2020-08-24
    • 1970-01-01
    • 2020-04-06
    • 2016-09-26
    • 1970-01-01
    相关资源
    最近更新 更多