Issue
Is it possible to create a custom dialog in JavaFX which isn't an OS-level window? (It would be a popup window displayed over top everything else on the main stage, which can't leave the application window.) i.e. An Adobe/Apache Flex style dialog, for anyone familiar.
Solution
Its actually quite easy and without a need to use 3rd party library:
Embed your root container within stackpane and over the top put anchor pane , create dialog box control(container/containers+controls).
To demonstrate what i mean here is a small fxml file:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<StackPane xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
<children>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: black;" />
<AnchorPane prefHeight="200.0" prefWidth="363.0">
<children>
<BorderPane layoutX="84.0" layoutY="123.0" prefHeight="99.0" prefWidth="227.0" style="-fx-background-color: red;">
<center>
<Button mnemonicParsing="false" text="Button" BorderPane.alignment="CENTER" />
</center>
</BorderPane>
</children>
</AnchorPane>
</children>
</StackPane>
You can make it moveable with properties,listener. It will require some work bud its doable.
Bud as jewelsea mentioned controlsfx has already what you need implemented, if i remember correctly they also provided controlfx samples jar where you can see sourcecode and all the included stuff in action, first take a look at that if anything in there fits your needs.Its really trivial to then implement it from that point on, i only had trouble in a past with one of theyr controls when i updated to new version of java.
Answered By - Tomas Bisciak
Answer Checked By - David Marino (JavaFixing Volunteer)