Not an announcement! A confusion

13 views
Skip to first unread message

ian godman

unread,
Aug 21, 2021, 2:10:50 PM8/21/21
to ScalaFX Users
I am building a desktop application as a way to improve my Scala skills and learn ScalaFX.

I am getting an error in IntelliJ that I find confusing, example show me to do what I am doing but I get 

    type mismatch;
     found   : scalafx.scene.input.KeyEvent => Unit
     required: this.FilterMagnet[javafx.scene.input.KeyEvent,?]
                ke: KeyEvent =>  {

screenshot below - get the same result always even in a new project with just one text field on the screen.

Tried many options with a filter magnet to no avail confused because I thought it should implicitly convert to a FilterMagnet.

Using ScalaFX 15.0.1-R21 with Scala 2.13.5 


Capture.jpg

Mark Lewis

unread,
Aug 22, 2021, 12:25:12 PM8/22/21
to ScalaFX Users
I'm not certain if it pertains to this particular error, but it feels like something that happens to students occasionally. Do you have `import scalafx.Includes._` in the file? That brings in a lot of implicit conversions between JavaFX and ScalaFX libraries.
Reply all
Reply to author
Forward
0 new messages