Implementing Own Window

Hello,

i’m very new to the whole smartgwt world so i start with some basic examples to get an impression how things work together.

i started to created my own window which i want extend with more functionality later but my first test look like this:

public class MyWindow extends Window {
    public MyWindow(String title) {
        super();
        setTitle(title) ;
         
        Canvas c = new Canvas();
	c.setContents("Hello !!!");
	addMember(c); 
    }
}

the result look’s like a window but the windowtitle and the windowcontrols are in the body of the window and the content of canvas gets displayed at the position where i would expect the window title.
I expected that the canvas would show in the body of the window. Did i something wrong?

The version’s in use are:
SmartGWT: 1.0b2
GWT: 1.53

Thanks.

Use addItem(…) instead of addMember(…) :

http://forums.smartclient.com/showthread.php?t=4555

Thanks for your hint, but with addChild the result looks like my screenshoot.

if i do something like

canvas.setTop(20);

the result looks like i would expect, but should’n it work without ?

As notz said, use addItem, not addChild.

sorry for the noise. it’s working now thanks !!