full screen contentPanel ext gwt

只谈情不闲聊 提交于 2019-12-25 02:23:11

问题


I need to implement full screen ContentPanel in ext gwt. I use setSize method, but as params I can specify only resolution.

public class HomePage extends ContentPanel {

public HomePage() {

    setSize(1024,768);

I want to have panel that will fill all window in each browser with different monitor resolution. So how can I use setsize method to solve this problem? Thanks!


回答1:


Instead of setting the size, maybe try setting a layout that will expand. Maybe something like this (hasn't been tested):

setLayout(new FitLayout()); 



回答2:


In GXT 3, I used:

private static final int WIDTH_SCREEN = XDOM.getViewportWidth();
private static final int HEIGTH_SCREEN = XDOM.getViewportHeight();

And after that use setWidth, setHeight



来源:https://stackoverflow.com/questions/5392889/full-screen-contentpanel-ext-gwt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!