将表单添加到弹出阶段(自定义阶段内容)

时间:2016-08-16 10:24:52

标签: forms javafx stage

我有一个名为添加新用户的按钮,通过点击弹出窗口应该包含添加用户表单。 这是我按钮的功能:

public void  btnAddeNewClicked(){


        final TextField name = new TextField() ;
        final TextField addr = new TextField() ;
        final TextField wp = new TextField() ;
        final TextField state = new TextField() ;
        final TextField loginName = new TextField() ;
        final Label labelUsername = new Label();
        final Label labelAddress = new Label();
        final Label labelWebPage = new Label();
        final Label labelState = new Label();
        final Label labelloginName = new Label();
        final Button btn = new Button("Add");


        Stage dialog = new Stage();
        dialog.initStyle(StageStyle.UTILITY);
        Scene scene = new Scene(btn);
        dialog.setScene(scene);
        dialog.show();


}

问题是我不知道如何将我的表单添加到我的舞台中。任何帮助都非常感谢:)

0 个答案:

没有答案