Frage

While exploring the basic concepts of JavaFX, the following question arose:

Is there a way to customize the layout of composite controls (such as TreeView or Accordion)?

For example, to achieve a horizontal arrangement of child elements or to introduce animations.

War es hilfreich?

Lösung

Some controls include API for controlling their layout. For example, you can set the orientation of a ListView to Horizontal or Vertical or switch animation on or off in a TitledPane.

You can write your own skins to apply to existing controls and modify their layout.
Public API for control skinning is provided in Java 8. Use the -fx-skin attribute to change a skin via css. More details are in the JavaFX wiki control skinning section.

Using custom skins you can completely change the layout and animations for a control. See for instance this carousel skin of a TreeView.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top