2 Replies Latest reply: Nov 5, 2012 6:19 PM by 858139 RSS

    How to pass data to popup dialog

    858139
      Hi All,

      How do I pass some data from the main window to the popup dialog. Please help.

      Thanks in advance.
        • 1. Re: How to pass data to popup dialog
          972422
          I think you can create a Group with a scene that contain the value from the main window then use the getContent.add() method of Popup.

          Group root = new Group();
          Scene scene = new Scene(root,200,200);
          //add the value form main windown to scene
          ......

          Popup pop = new Popup();
          pop.getContent().add(root);

          Glad if this can help you
          • 2. Re: How to pass data to popup dialog
            858139
            Thanks for your response.

            I found out that we can use setUserData() and getUserData() in Node class to pass data between windows. The only problem I have is I'm using FXML for popup dialog so the Scene of my popup in the initialize funtion is always null.