Resize smaller

1 view
Skip to first unread message

harislukman

unread,
Mar 14, 2008, 5:28:49 AM3/14/08
to Gwt Window Manager
hi guys,

i have problem with resizing the frame into smaller size.

i created a vertical panel with size (360, 300)

then i add the vertical panel into the DefaultGInternalFrame

frame.setContent(verticalPanel);

i noticed that after the vertical panel is rendered into the frame,
the frame minimal size is set according to the vertical panel size.

once the frame is loaded, i can't resize the frame into smaller size?
anybody have clue on that? your help will be greatly appreciated

thank you in advanced.

regards,

Haris

harislukman

unread,
Mar 14, 2008, 5:40:20 AM3/14/08
to Gwt Window Manager
i wanted the frame to be able to be resize to the smaller size than
(360, 300)

moss

unread,
Apr 29, 2008, 4:12:51 AM4/29/08
to Gwt Window Manager
The problem is that the window uses a HTML table for its
implementation. A HTML table always sizes to the maximum size of its
content. So you can not force a HTML table to become smaller than its
content. So to solve this problem you must also resize the content of
the cell. To do this you can overwrite the setSize function of the
window like this:

public void setSize (int width, int height)
{
super.setSize (width, height);

// Check if the new size was really applied.
if (width != this.getWidth () || height != this.getHeight ())
{
// If not resize the content first ...
verticalPanel.setPixelSize (width - this.xOffset, height -
this.yOffset);
// ... then try again
super.setSize (width, height);
}
}

The offset values are the widths of the windows border. Also note that
sizing the verticalPanel might also not work, so check what it
contains.
Reply all
Reply to author
Forward
0 new messages