dialog - DialogBox in GWT isn't draggable or centred -


i'm new gwt programming. far have dialogbox supposed collect login , password, can if required launch dialogbox allows create new account.

the first of these 2 dialogboxes appears @ top left of browser screen, , can't dragged, although part of definition of dialogbox can dragged. however, second dialogbox can dragged screen without problem.

what i'd first dialogbox appear in middle of screen & draggable, both of thought happen automatically, there's not.

so, things can stop dialogbox being draggable? there nothing on rootpanel yet. make difference?

code fragments available if help, perhaps general outline enough pointers.

thanks neil

use dialogbox.center() center dialogbox in middle of screen. dialogbox default draggable.

just tried out , doens't matter if rootpanel empty our not. when show dialogbox on moduleload draggable , centered. problem situated somewhere else.

this example of google itself:

public class dialogboxexample implements entrypoint, clicklistener {    private static class mydialog extends dialogbox {      public mydialog() {       // set dialog box's caption.       settext("my first dialog");        // dialogbox simplepanel, have set widget property       // whatever want contents be.       button ok = new button("ok");       ok.addclicklistener(new clicklistener() {         public void onclick(widget sender) {           mydialog.this.hide();         }       });       setwidget(ok);     }   }    public void onmoduleload() {     button b = new button("click me");     b.addclicklistener(this);      rootpanel.get().add(b);   }    public void onclick(widget sender) {     // instantiate dialog box , show it.     new mydialog().show();   } } 

here more information dialogbox.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -