window.alert更改gwt中的标题
什么时候** 窗口警报 **在gwt中使用,会弹出一个窗口,显示消息“我想** 改名 **对于该窗口,请提供帮助,因为我急需它。alert()打开一个本机对话框,其中包含“确定”按钮。你不能更改它的标题window.alert更改gwt中的标题,gwt,uibinder,gwt2,Gwt,Uibinder,Gwt2,什么时候** 窗口警报 **在gwt中使用,会弹出一个窗口,显示消息“我想** 改名 **对于该窗口,请提供帮助,因为我急需它。alert()打开一个本机对话框,其中包含“确定”按钮。你不能更改它的标题 使用或您不能更改该..的标题。为此,您需要寻找其他替代 下面是其中之一 下面是一个简单的对话框,它是从GWT示例代码生成的 // Create the popup dialog box final DialogBox dialogBox = new DialogBox(); di
使用或您不能更改该..的标题。为此,您需要寻找其他替代 下面是其中之一 下面是一个简单的对话框,它是从GWT示例代码生成的
// Create the popup dialog box
final DialogBox dialogBox = new DialogBox();
dialogBox.setText("Remote Procedure Call");
dialogBox.setAnimationEnabled(true);
final Button closeButton = new Button("Close");
// We can set the id of a widget by accessing its Element
closeButton.getElement().setId("closeButton");
final Label textToServerLabel = new Label();
final HTML serverResponseLabel = new HTML();
VerticalPanel dialogVPanel = new VerticalPanel();
dialogVPanel.addStyleName("dialogVPanel");
dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
dialogVPanel.add(textToServerLabel);
dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
dialogVPanel.add(serverResponseLabel);
dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
dialogVPanel.add(closeButton);
dialogBox.setWidget(dialogVPanel);
//创建弹出对话框
final DialogBox DialogBox=新建DialogBox();
setText(“远程过程调用”);
dialogBox.setAnimationEnabled(true);
最终按钮关闭按钮=新按钮(“关闭”);
//我们可以通过访问小部件的元素来设置小部件的id
closeButton.getElement().setId(“closeButton”);
最终标签textToServerLabel=新标签();
final HTML serverResponseLabel=新HTML();
VerticalPanel dialogVPanel=新建VerticalPanel();
dialogVPanel.addStyleName(“dialogVPanel”);
添加(新的HTML(“向服务器发送名称:”);
dialogVPanel.add(textToServerLabel);
添加(新的HTML(
服务器回复:);
dialogVPanel.add(serverResponseLabel);
对话框面板设置水平对齐(垂直面板右对齐);
对话框面板添加(关闭按钮);
setWidget(dialogVPanel);
在中间添加标签和小部件以获得所需的对话框。如何将内容添加到dialogBox,我创建了一个标签并将其添加到dialogBox,然后添加了一个按钮-它会抛出一个例外使用布局面板。i、 垂直面板、水平面板等。把小部件放进去。最后在对话框中添加此布局和widgets组。因为您只允许在dialogbox中放置一个小部件。谢谢,它起了作用。:)@Ekata,如果您觉得这个答案有用,那么您应该接受它。