'<==' unknown by intellij while using scalafx

别来无恙 提交于 2019-12-12 20:14:45

问题


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


回答1:


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.)




回答2:


You are missing

import scalafx.Includes._

in your imports.



来源:https://stackoverflow.com/questions/20520122/unknown-by-intellij-while-using-scalafx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!