Working with JFXtras-Agenda, how to add it to the fxml-File

1.4k views Asked by At

How can I add the JFXtras Agenda to my fxml-File, since I usually work with the Scenebuilder, i´m not very experienced with fxml Coding. It would be great if someone can show some of his/her Code.

1

There are 1 answers

1
tbeernot On BEST ANSWER

Agenda can be added to an fxml file by importing jfxtras.scene.control.agenda.* and then creating a Agenda tag. However, the API of Agenda is a bit more involving than the usual control, so even though adding the control to FXML is easy, after that you should manipulate it from Java. Below is a working FXML example:

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

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import jfxtras.scene.control.agenda.*?>

<HBox xmlns:fx="http://javafx.com/fxml">
    <Agenda id="id1"/>
</HBox>

SceneBuilder has very limited support for 3rd party controls; not only is there a lot of stuff about JavaFX's embedded controls hardcoded into scenebuilder, it also has a problem when a control uses additional libraries, or -as JFXtras- is split over separate jars. So you need to add the jfxtras-all jar to SceneBuilder and hope that it won't stumble...