2016-09-11 11 views
1

scala 2.11 + JavaFX 프로젝트를 2.12.0-RC1로 업데이트하면 코드가 Java @FXML annotation을 집중적으로 사용합니다. FXMLLoader.load을 실행하는 동안주석 정보가 scala 2.12 trait에서 손실 됨

trait MainController { 
    @FXML def onRun(event: ActionEvent) { 
    val script = currentEngine.executeScript("editor.getValue()").toString 
    runScript(script) 
    } 
} 

<MenuItem mnemonicParsing="false" onAction="#onRun" text="Run"> 
    <accelerator> 
     <KeyCodeCombination alt="UP" code="R" control="UP" meta="UP" shift="UP" shortcut="DOWN"/> 
    </accelerator> 
</MenuItem> 

는 런타임시이 오류가 발생합니다 :

javafx.fxml.LoadException: Error resolving onAction='#onRun', either the event handler is not in the Namespace or there is an error in the script. 

@FXML 주석 정보를 컴파일하는 동안 손실 된 것으로 보인다

. 2.12에서 모든 특성이 인터페이스로 컴파일되었다고 들었지만이 변경으로 인해 문제가 어떻게 발생합니까? 해결 방법이 있습니까?

답변

0

이유는 알 수 없지만이 문제는 scala-2.12.0-RC2에서 해결되었습니다. 감사합니다, 스칼라 팀.