This is a tough question to answer because it doesn't really show what you've tried to do, but I will attempt to put my comment suggestion to light and show you a simple example that might be closer to what you want.
Create a simple FXML file (for JavaFX) that defines a pane with a label on it.
Give the label an ID and assign a controller to it.
Sample file (TestDialog.fxml), defining a simple pane with a label:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane minHeight="111.0" mouseTransparent="false" opacity="1.0" prefHeight="111.0" prefWidth="244.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="MyController">
<children>
<Label fx:id="textLabel" layoutX="22.0" layoutY="25.0" minHeight="13.0" prefHeight="61.0" prefWidth="200.0" text="SOME TEXT" textFill="BLACK">
<font>
<Font size="36.0" />
</font>
</Label>
</children>
</AnchorPane>
In your controller class, define a function that will allow you to close the pane. You may or may not want more, depending on your needs.
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.stage.Stage;
import java.net.URL;
import java.util.ResourceBundle;
public class MyController implements Initializable {
@FXML
private Label textLabel;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
}
public void close() {
((Stage)textLabel.getScene().getWindow()).close();
}
}
Then, in your main code, display the window. This example opens it as a top-level, but you can use it as a child stage too.
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class Main extends Application {
@Override
public void start(Stage stage) throws Exception {
FXMLLoader myLoader = new FXMLLoader(getClass().getResource("TestDialog.fxml"));
Parent root = (Parent)myLoader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.initStyle(StageStyle.UNDECORATED); // this style sets the stage to have no border or buttons/title bar
stage.setResizable(false);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
The result looks like this

*Note that this code, as written, does not provide a way to close the dialog. That's an exercise left up to you. This was simply an example used to show you the effect.