Creating a fluid panel in GWT to fill the page?

前端 未结 8 2127
不思量自难忘°
不思量自难忘° 2021-02-05 09:53

I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following:

public class M         


        
8条回答
  •  春和景丽
    2021-02-05 10:34

    For me it does not work if I just set the width like

    panel.setWidth("100%");

    The panel is a VerticalPanel that it just got a randomly size that I don't know where it comes from. But what @Ben Bederson commented worked very well for me after I added the line:

    panel.setWidth(Window.getClientWidth() + "px");

    Just this, nothing else. Thanks

提交回复
热议问题