有没有快速的方法来删除JavaFX中的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"));
Run Code Online (Sandbox Code Playgroud)
是的,您可以通过将图形和标题文本设置为null来实现此目的:
dialog.setHeaderText(null);
dialog.setGraphic(null);
Run Code Online (Sandbox Code Playgroud)