簡體   English   中英

不顯示SimplePanel

[英]SimplePanel not being displayed

我有以下代碼用於創建FlowPanel和幾個SimplePanel:

    panel = new FlowPanel();
    panel.setStylePrimaryName(MSTYLE);

    sPanel1 = new SimplePanel();
    sPanel.setStyleName(BSTYLE);

    RowLabel = new Label();

    sPanel2 = new SimplePanel();
    sPanel2.setStyleName(BSTYLE);

    panel.add(sPanel1);
    panel.add(RowLabel);
    panel.add(sPanel2);

但是,當我在瀏覽器中查看頁面時,我看不到簡單的面板-僅顯示標簽。我還缺少其他東西嗎? 謝謝。

我認為您的SimplePanel寬度為0px,高度為0px,因為它們不包含任何內容。

嘗試在簡單面板上添加標簽,然后查看是否顯示。 之后,嘗試給SimplePanel設置寬度和高度(sPanel1.setSize(width,height))。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM