when **
Window.alert
** is used in gwt, a window pops up with the message , I want to **
change the title
** of that window , Please help as I need it urgently
when **
Window.alert
** is used in gwt, a window pops up with the message , I want to **
change the title
** of that window , Please help as I need it urgently
Window.alert() opens a native dialog box which contais OK button. You can not change the title of it.
Use PopupPanel or DecoratedPopupPanel or DialogBox
You cant change the title of that ..for that you need to look into another alternative ..
Below is one of them.
Here is a simple dialog box which is genreated from GWT sample code
// 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);
Add your lables and widgets in middle to get the desired dialog ..