문제

I am using BorderPane as a root pane of FXML file. However, the compiler complains that BorderPane has no controller property! How to bind a controller class to a FXML whose root is BorderPane?

<BorderPane id="rootPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.saei.explorer.FXMLDocumentController">

I am using BorderPane because of its capability of stretching the layout on re-sizing the window.

도움이 되었습니까?

해결책

Oops, it turns out that I used xmlns property of JavaFX 8 within JavaFX 2.2 environment. I just replaced:

xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"

with:

xmlns:fx="http://javafx.com/fxml"

and it works now!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top