“void is an invalid type for the variable buttonOK” - trying to close dialog after clicking button

前端 未结 3 746
梦谈多话
梦谈多话 2021-01-28 07:08

Some time ago i\'ve made a simple dialog. Everything looks fine, but i\'m meeting troubles after trying to close it. The error is \"void is an invalid type for the variab

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 07:34

    You have defined a method (buttonOK()) within another method (aboutApp()). This is not possible in Java. The compiler tries to make sense of this and supposes somhow that buttonOk is meant as a variable -- thus the misleading error message.

提交回复
热议问题