内容面板自动调整大小 gxt

发布于 2024-11-07 03:30:55 字数 1498 浏览 0 评论 0原文

我正在使用 gxt 实现用户界面。我有带有 TabPanel 的 mainForm 类。 TabPanel 的 TabItem 很少。在 orderManagmentTabItem 上,我有一个 ContentPanel。

TabPanel mainFormTab = new TabPanel ();
    mainFormTab.setAutoHeight(true);
    mainFormTab.setAutoWidth(true);

    TabItem orderManagmentTabItem = new TabItem("TabItem 1");
    orderManagmentTabItem.setAutoWidth(true);
    orderManagmentTabItem.setAutoHeight(true);
    OrderManagmentTabPanel orderManagmentTabPanel = new OrderManagmentTabPanel(); //contentpanel
    orderManagmentTabItem.add(orderManagmentTabPanel);

    TabItem warehouseManagmentTabItem = new TabItem("TabItem 2");
    warehouseManagmentTabItem.setAutoWidth(true);
    warehouseManagmentTabItem.setAutoHeight(true);

所以我想将 Autozise 设置为 orderManagmentTabPanel,但不能这样做。我在 orderManagmentTabPanel 类中编写 setAutoHeight(true) 和 setAutoWidth(true) ,但是当我运行我的应用程序 orderManagmentTabPanel 时,它是空的。 比我尝试在创建 OrderManagmentTabPanel 副本后设置自动大小

TabItem orderManagmentTabItem = new TabItem("TabItem 1");
    orderManagmentTabItem.setAutoWidth(true);
    orderManagmentTabItem.setAutoHeight(true);
    OrderManagmentTabPanel orderManagmentTabPanel = new OrderManagmentTabPanel(); //contentpanel
    orderManagmentTabPanel.setAutoWidth(true);
    orderManagmentTabPanel.setAutoHeight(true);
    orderManagmentTabItem.add(orderManagmentTabPanel);

,但也没有帮助还

尝试在没有 ContenPanel 的情况下实现 TabItem 类并将其添加到 mainFormTab,但也不起作用。

如何使 TabItem 自动调整大小?

谢谢

I am implementing a user interface using gxt. I have mainForm class with TabPanel.
TabPanel has few TabItems. On orderManagmentTabItem I have a ContentPanel.

TabPanel mainFormTab = new TabPanel ();
    mainFormTab.setAutoHeight(true);
    mainFormTab.setAutoWidth(true);

    TabItem orderManagmentTabItem = new TabItem("TabItem 1");
    orderManagmentTabItem.setAutoWidth(true);
    orderManagmentTabItem.setAutoHeight(true);
    OrderManagmentTabPanel orderManagmentTabPanel = new OrderManagmentTabPanel(); //contentpanel
    orderManagmentTabItem.add(orderManagmentTabPanel);

    TabItem warehouseManagmentTabItem = new TabItem("TabItem 2");
    warehouseManagmentTabItem.setAutoWidth(true);
    warehouseManagmentTabItem.setAutoHeight(true);

So I want to set Autozise to orderManagmentTabPanel, but can't do this. I write setAutoHeight(true) and setAutoWidth(true) in orderManagmentTabPanel class, but whet I run my app orderManagmentTabPanel is empty.
Than I tried to set autosize after creating OrderManagmentTabPanel copy

TabItem orderManagmentTabItem = new TabItem("TabItem 1");
    orderManagmentTabItem.setAutoWidth(true);
    orderManagmentTabItem.setAutoHeight(true);
    OrderManagmentTabPanel orderManagmentTabPanel = new OrderManagmentTabPanel(); //contentpanel
    orderManagmentTabPanel.setAutoWidth(true);
    orderManagmentTabPanel.setAutoHeight(true);
    orderManagmentTabItem.add(orderManagmentTabPanel);

But didn't help also

Also tried to implement TabItem class without ContenPanel and add it to mainFormTab, but also didn't work.

How can I make my TabItem to be autosized?

Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多孤肩上扛 2024-11-14 03:30:55

好的,所以我相信你的意思是(如果我错了,请纠正我)你的选项卡项目上有一个面板,并且试图确保它占用 100% 的空间?

例如尝试设置布局

orderManagmentTabItem.setLayout(new FillLayout()); //Sounds like what your after

OK so I believe you mean (correct me if I am are wrong) you have a panel on a tab item and are trying to ensure it takes 100% of the space?

try setting a layout for example

orderManagmentTabItem.setLayout(new FillLayout()); //Sounds like what your after
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文