JavaFX Properties in TableView

One somewhat strange part of the property API is that IntegerProperty implements ObservableValue<Number>, not ObservableValue<Integer>. So, somewhat counterintuitively, you need TableColumn<Person, Number> ageColumn = new TableColumn<Person, Number>(“Age”); As an aside, and I’m not sure if this causes problems, but it’s more usual to use int instead of Integer for the return type for the get … Read more

Kotlin. Basic JavaFX application

The code samples you provided are not equivalent: an object declaration in Kotlin is a singleton, so it only has one instance constructed by calling the private constructor when the class is initialized. JavaFX is trying to call the constructor of the class reflectively but fails because the constructor is private as it should be. … Read more

Include ControlsFX in Scene Builder?

Yes you can. But unfortunately all ControlsFX controls are not supported by scene builder. An issue titled, “All controls should be supported by SceneBuilder” is currently opened with the ControlsFX team. Update Since SceneBuilder 8.2.0 you can directly search for an artifact from SceneBuilder and include them using the brand new Library Manager \o/ To … Read more

Styling default JavaFX Dialogs

You can style your dialogs with your own css file, but for that you need to take into consideration that the dialog is in fact a new stage, with a new scene, and the root node is a DialogPane instance. So once you create some dialog instance: @Override public void start(Stage primaryStage) { Alert alert … Read more

FXML full reference?

FXML Reference Introduction to FXML describes the syntax and usage patterns of the markup and is important to study when learning FXML. It does not define all elements usable in FXML. There will never be a full reference (nor xml schema) for FXML as it works by reflecting on Java classes in the classpath and … Read more

Mouse Events get Ignored on the Underlying Layer

Solution Add the following line to your sample code: layerB.setPickOnBounds(false); This will allow the mouse to interact with the visible elements you can see through the layers of your stacked elements. If elements in the top layer overlap elements in the bottom layer clicking on the part of the top layer which overlaps the bottom … Read more

JavaFX 2.0: Closing a stage (window)

The documentation you linked states that stage.close(): Closes this Stage. This call is equivalent to hide(). As hide() is equivalent to close() and close() closes the stage, then hide() also closes the stage. When all stages in an application are hidden (or closed if you like, because it is the same thing), the application exits. … Read more