'<==' unknown by intellij while using s

2019-07-20 03:42发布

A sign is not recognized by intellij : "<==", in a scala program using scalafx.

The scalafx version of the jar is 2.10:1.0.0-M5. the program is this:

object launcher extends JFXApp {

stage = new JFXApp.PrimaryStage {
    title = "Hello Stage"
    width = 600
    height = 450
    scene = new Scene {
        fill = Color.LIGHTGREEN
        content = new Rectangle {
            x = 25
            y = 40
            width = 100
            height = 100
            fill <== when (hover) choose Color.GREEN otherwise Color.RED
        }
    }
}

}

do you know where does the error comes from?(the intellij version is the last one : v13).java version is 1.7.0 x64 for mac, and scala version is 2.10.0. Please note thet "choose" & "otherwise" are also not recognized. thanks

2条回答
Root(大扎)
2楼-- · 2019-07-20 04:30

You're missing the imports for ScalaFX itself. See the full listing in the Wiki: https://code.google.com/p/scalafx/wiki/GettingStarted

(Yes, the documentation should include these. I encountered similar problems at the start.)

查看更多
Animai°情兽
3楼-- · 2019-07-20 04:33

You are missing

import scalafx.Includes._

in your imports.

查看更多
登录 后发表回答