我正在使用Gwt,

我有一个标签。在onClick事件上有一个PopupPanel,添加了Whre tree
 问题是popupPanel是透明的。

执行popup.show时,通过panel可以看到popupPanel后面的popupPanel。如何避免这种情况。

    .
    .
        lblClass.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            getPopupPanel();
                        }
                    });
private PopupPanel getPopupPanel(){

            popupPanel = new PopupPanel();
            popupPanel.setStyleName("documentClass-PopPup");
            int x =lblClass.getAbsoluteLeft();
            int y = lblClass.getAbsoluteTop();
            popupPanel.setPopupPosition(x, y+20);
            popupPanel.add(getCustomPropertiesTree());
            popupPanel.show();

        return popupPanel;
    }

CSS

.documentClass-PopPup {
    margin: 2px 1px 1px;
    padding: 2px 1px 1px;
    border-top: thick;
    border-right: medium;
    border-bottom: medium;
    border-left: medium;
    font-size: 10pt;
    letter-spacing: normal;

}

最佳答案

为“ documentClass-PopUp”定义背景色

.documentClass-PopPup {
  background-color: white;
}


或使用

popupPanel.addStyleName("documentClass-PopPup");


代替

popupPanel.setStyleName("documentClass-PopPup");

07-24 19:50