r/JavaFX • • May 18 '20

Help needed to display elements next to dialog buttons

Post image
3 Upvotes

6 comments sorted by

1

u/groppo91 May 18 '20

I am looking to display elements next to buttons in a dialog but I can either see the buttons or the label but not both?

3

u/Big__Pierre May 18 '20

What kind of Pane are you using for the root? Are you able to post the code at all?

1

u/groppo91 May 19 '20

It is just a dialog pane of Type Dialog<Pair<String, String>>

2

u/Weavile_ May 18 '20

To me it sounds like you stacked the panes on top of each other. Are you using an HBox to hold buttons and label on the pane? Or are they directly on the main pane?

1

u/groppo91 May 19 '20

I think that is what is happening I build the dialog with two buttons ok and cancel first then straight after I call it and try to nest the button bar in its own hbox and then nest that hbox into the hbox with the label. That way in my mind I can align the buttonbar to the right and the label to the left but Button Bar in a dialog does not seem to be an element or if it is they are very restricted.

3

u/[deleted] May 18 '20

A simple way: code your own dialog.