简体   繁体   中英

JavaFX FXML create component/control

How to create custom control like Pagination , ProgressIndicator etc.

Using JavaFX SceneBuilder Custom component can be created but its FXML contains all hierarchy of tags . But Pagination does not contains hierarchy of tags (ex button , list etc) , it contains single tag <pagination> with some attribute .

So my question is that how to create components like pagination that does not show its internal tag hierarchy ?

I asked for a tutorial some time ago, but unfortunately the issue is still open: https://bugs.openjdk.java.net/browse/JDK-8090885

Basically you'll need to:

  • provide a class which extends Control and defines the interface
  • provide a subclass of SkinBase for this control to provide the content
  • provide a CSS (now optionally, I think)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM