本文介绍了JavaFX对话框删除标题装饰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有快速的方法来删除JavaFX中的Dialog标头?或者我应该去创建自己的对话框?
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"));
推荐答案
是的,您可以通过将图形和标题文本设置为null来实现此目的:
Yes, you can achieve this by setting the graphic and header text to null:
dialog.setHeaderText(null);
dialog.setGraphic(null);
这篇关于JavaFX对话框删除标题装饰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!