Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sizing SmartGWT Window based on contents

Tags:

java

gwt

smartgwt

I'm trying to get a SmartGWT Window sizing based on its contents.

The correct way of adding elements to a Window it's through the addItem method.

So, when I run this code, the Window do not get resized. However, if I add the Label through addMember the resizing works fine but this break the Window appearance

Window window = new Window();
window.setOverflow(Overflow.VISIBLE);

window.addItem(new Label("aaaaaaaa"));
window.addItem(new Label("aaaaaaaa"));
window.addItem(new Label("aaaaaaaa"));
window.addItem(new Label("aaaaaaaa"));
window.addItem(new Label("aaaaaaaa"));
window.show();

Any ideas ?

Using SmartGWT 2.5

like image 935
Jean-Michel Garcia Avatar asked May 25 '12 14:05

Jean-Michel Garcia


1 Answers

I missed the AutoSize property... Works as expected

window.setAutoSize(true);
like image 113
Jean-Michel Garcia Avatar answered Sep 28 '22 12:09

Jean-Michel Garcia