MaterialFX
MaterialFX copied to clipboard
MFXGenericDialog.setContent : Node is not displayed
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 ?
I tried to call the same method but not in the builder it's working
dialogContent.setContent(vBox);
I'll investigate the issue thanks for the report
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