public class Main implements EntryPoint, MouseDownHandler
{
DialogBox a = new DialogBox(false, false);
DialogBox b = new DialogBox(false, false);
public void onModuleLoad()
{
a.setText("AAAAAAAAAAA");
a.setWidget(new Label("aaaaaaaaa"));
a.getElement().getStyle().setProperty("backgroundColor", "cyan");
a.getCaption().addMouseDownHandler(this);
a.center();
b.setText("BBBBBBBBBBBBB");
b.setWidget(new Label("bbbbbbbbbb"));
b.getElement().getStyle().setProperty("backgroundColor", "yellow");
b.getCaption().addMouseDownHandler(this);
b.center();
}
@Override
public void onMouseDown(MouseDownEvent event)
{
Widget d = (Widget) event.getSource();
DialogBox c = (DialogBox) d.getParent();
a.getElement().getStyle().setProperty("zIndex", "0");
b.getElement().getStyle().setProperty("zIndex", "0");
c.getElement().getStyle().setProperty("zIndex", "1");
}
}