/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javafxapplication2; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import org.jfxtras.stage.XDialog; import org.jfxtras.scene.XScene; import javafx.stage.StageStyle; import javafx.scene.shape.Rectangle; import javafx.scene.layout.VBox; import javafx.scene.control.Label; import javafx.geometry.HPos; import javafx.scene.paint.Color; Stage { title: "Dialog" scene: Scene { width: 200 height: 200 content: [ Button { text: "Button" action: function () { def xd: XDialog = XDialog { style: StageStyle.DECORATED modal:true resizable: true scene: XScene { width: 300 height: 300 content: [ Rectangle { width: 300 height: 300 arcWidth: 20 arcHeight: 20 }, VBox { nodeHPos: HPos.CENTER spacing: 20 content: [ Label { text: "Hello, I'an modal" textFill: Color.WHITE } Button { text: "CLose" action: function () { xd.close(); } } ] } ] } } } } ] } }