MaterialFX icon indicating copy to clipboard operation
MaterialFX copied to clipboard

MFXGenericDialog.setContent : Node is not displayed

Open chuckdu21 opened this issue 2 years ago • 2 comments

Hi, Here is my code :

MFXGenericDialog dialogContent = MFXGenericDialogBuilder.build()
                    .setContent(vBox)
                    .makeScrollable(true)
                    .get();

            MFXStageDialog dialog = MFXGenericDialogBuilder.build(dialogContent)
                    .toStageDialogBuilder()
                    .initOwner(this.dialogStage)
                    .initModality(Modality.APPLICATION_MODAL)
                    .setDraggable(true)
                    .setTitle("Personne")
                    .setOwnerNode(this.viewGraph)
                    .setScrimPriority(ScrimPriority.WINDOW)
                    .setScrimOwner(true)
                    .get();

            dialogContent.setPrefSize(600, 500);
            dialogContent.setMinSize(600, 500);
            dialogContent.setMaxSize(600, 500);
            dialog.showDialog();

vBox is a VBox element with multiple Pane inside. But this vbox is not displayed in the dialog window.

setContentText is working. I tried to put a simple Button like so: .setContent(new Button("test")) Does not work either...

Is this a bug or i did something wrong ?

chuckdu21 avatar Sep 27 '22 07:09 chuckdu21

I tried to call the same method but not in the builder it's working dialogContent.setContent(vBox);

chuckdu21 avatar Sep 27 '22 07:09 chuckdu21

I'll investigate the issue thanks for the report

palexdev avatar Sep 30 '22 06:09 palexdev

Turns out when you use makeScrollable(...) the content you set is overwritten by the scroll pane I added a method in recent versions that also accept a Node as parameter, that will be used as the content of the scroll area

palexdev avatar Mar 16 '23 13:03 palexdev