JavaFX对话框删除标题装饰

JavaFX对话框删除标题装饰,javafx,dialog,Javafx,Dialog,在JavaFX中有没有快速删除对话框头的方法?还是我应该去创建自己的对话框 TextInputDialog dialog = new TextInputDialog(); dialog.setTitle("create DATABASE"); dialog.setHeaderText("create DATABASE"); dialog.setContentText("Ingrese un nombre:"); dialog.showAndWait().ifPresent(name ->

在JavaFX中有没有快速删除对话框头的方法?还是我应该去创建自己的对话框

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"));  

是的,您可以通过将图形和标题文本设置为空来实现:

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

这是一个非常简单的set
dialog.setHeaderText(null)
对话框,它将删除标题。
有关详细信息,请查看

是否尝试了
对话框。setHeaderText(null)