Tuesday, February 28, 2012

Re: the output of DialogBox is very strange

thanks for the reply.
I found the problem seems related to Dialogbox.setsize(), if call this
method, the dialogBox will be very strange, just try the following to

public class GWTTest1 implements EntryPoint, ClickHandler {

private static class MyDialog extends DialogBox {

public MyDialog() {
// Set the dialog box's caption.
setText("My First Dialog");

// Enable animation.

// Enable glass background.

// DialogBox is a SimplePanel, so you have to set its widget
property to
// whatever you want its contents to be.
ScrollPanel scrollPanel1 = new ScrollPanel();
//scrollPanel1.setSize("1800px", "500px");
Button ok = new Button("OK");

ok.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {


public void onModuleLoad() {
Button b = new Button("Click me");


public void onClick(ClickEvent event) {
// Instantiate the dialog box and show it.
MyDialog myDialog1 = new MyDialog();
// if myDialog1.setSize(), will throw very strange result!!
myDialog1.setSize("1800px", "500px");

if comment out the statement "myDialog1.setSize("1800px", "500px");"
and uncomment the statement //scrollPanel1.setSize("1800px", "500px");
everything is ok.
so I think the DialogBox.setSize() has some problem.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment