2

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

lolveley
  • 1,659
  • 2
  • 18
  • 34
  • I had this issue and fixed it by adding the javafx jar file to my java SDK paths in the module settings. The specific jar file I added was java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar. – david Mar 14 '15 at 20:08

2 Answers2

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

lancelet
  • 101
  • 2
  • well, I don't think: I use intellij idea but I have java 7 as a dependency for the project, the scalafx jar is installed (v1.0.0) & jfxrt.jar is also here (see this picture :http://fr.tinypic.com/r/rh25o7/5).I don't understand. – lolveley Dec 11 '13 at 14:32
0

You are missing

import scalafx.Includes._

in your imports.

Jarek
  • 1,513
  • 9
  • 16