JavaFX Dialogs remove header decoration

Viewed 4754

Is there a quick way to remove a Dialog header in JavaFX? Or should i just go and create my own dialog?

TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("create DATABASE");
dialog.setHeaderText("create DATABASE");
dialog.setContentText("Ingrese un nombre:");
dialog.showAndWait().ifPresent(name -> getCodeArea().setTemplateInjump("create database "+name+";\n\nuse "+name+";\n\n"));  

enter image description here

2 Answers

Yes, you can achieve this by setting the graphic and header text to null:

dialog.setHeaderText(null);
dialog.setGraphic(null);

It's very simple set dialog.setHeaderText(null) and it will remove the header. For more information have a look here

Related