SmartGWT window sizing based on content

I am trying to get the size of a SmartGWT Window based on its contents.

The correct way to add items to a window is via the addItem method.

So, when I run this code, the window does not change. However, if I add the label via addMember , resizing will be fine, but it will break the window

 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

+6
source share
1 answer

I missed the AutoSize property ... Works as expected

 window.setAutoSize(true); 
+6
source

Source: https://habr.com/ru/post/916675/


All Articles