If you open a Dialog without a header and later call Dialog.setHeaderText or Dialog.getDialogPane().setHeader, this leads to some strange effects:
1) The header area is not styled as expected
2) The button bar stays in place, although the content moves to make space for the header
To reproduce:
- Create Dialog without header and show it
- Add a header with Dialog.setHeaderText or Dialog.getDialogPane().setHeader
If the dialog initially has a graphic node the cancel button (ButtonType.CANCEL) will not react anymore after the header has been added.
To reproduce:
- Create Dialog with graphic but without a header and show it
- Add a header with Dialog.setHeaderText
-> Try to press "Cancel" - will not work
As a side note: The update of the graphic location on changing the header is not consistent. If the graphic is initialy displayed to the left of the content (because there is no header) the graphic is moved to the header area, if a header is added. If the grafic is initialy displayed in the header area, it will stay there, even if the header is removed.
1) The header area is not styled as expected
2) The button bar stays in place, although the content moves to make space for the header
To reproduce:
- Create Dialog without header and show it
- Add a header with Dialog.setHeaderText or Dialog.getDialogPane().setHeader
If the dialog initially has a graphic node the cancel button (ButtonType.CANCEL) will not react anymore after the header has been added.
To reproduce:
- Create Dialog with graphic but without a header and show it
- Add a header with Dialog.setHeaderText
-> Try to press "Cancel" - will not work
As a side note: The update of the graphic location on changing the header is not consistent. If the graphic is initialy displayed to the left of the content (because there is no header) the graphic is moved to the header area, if a header is added. If the grafic is initialy displayed in the header area, it will stay there, even if the header is removed.