문제

I created custom pane

MyStackPane extends StackPane

When I use it in FXML

<?xml version="1.0" encoding="UTF-8"?>

<?import application.MyStackPane?>

<MyStackPane xmlns:fx="http://javafx.com/fxml>
    <!-- TODO Add Nodes -->
</MyStackPane >

ClassNotFoundException throws. How can i use it in FXML?

도움이 되었습니까?

해결책

There is nothing obviously wrong with the FXML you present.

Oracle have a tutorial for creating a custom control and FXML. The tutorial links a project with source code. Read the tutorial, download the sample source and study it, then apply what you learned to your situation. The sample is really a small amount of code, but I don't want post it here because its Oracle's.

Note, you can use your custom pane from FXML in SceneBuilder, see the SceneBuilder documentation.

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