Java Method Call Expected

后端 未结 7 1320
隐瞒了意图╮
隐瞒了意图╮ 2020-12-17 18:49

This is a java program with two buttons used to change an integer value and display it. However in IntelliJIDEA the two lines with

increase.addActionListene         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-17 19:30

    It's simple: use new incListener() instead of incListener(). The later is trying to call a method named incListener, the former creates an object from the class incListener, which is what we want.

提交回复
热议问题