Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX Dialogs remove header decoration

Tags:

dialog

javafx

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

like image 218
Wesos de Queso Avatar asked Nov 14 '17 15:11

Wesos de Queso


Video Answer


1 Answers

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

dialog.setHeaderText(null);
dialog.setGraphic(null);
like image 123
MMAdams Avatar answered Oct 19 '22 04:10

MMAdams