JavaFX Dialogs remove header decoration

2019-06-18 04:31发布

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

标签: javafx dialog
2条回答
forever°为你锁心
2楼-- · 2019-06-18 05:07

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

dialog.setHeaderText(null);
dialog.setGraphic(null);
查看更多
姐就是有狂的资本
3楼-- · 2019-06-18 05:07

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

查看更多
登录 后发表回答