JavaFX - setOnAction not applicable

后端 未结 2 1228
再見小時候
再見小時候 2020-12-04 00:44

I am trying to learn JavaFX, and I\'ve written the code shown down below, however I seem to be having trouble with this line of code:

btn.setOnAction(new Eve         


        
2条回答
  •  悲&欢浪女
    2020-12-04 01:12

    You're mixing up Javafx with Swing. Replace

    import java.awt.event.ActionEvent;
    

    with

    import javafx.event.ActionEvent;
    

提交回复
热议问题