GWT弹出面板是透明的?

时间:2012-05-10 10:38:07

标签: java gwt popup gwt2 uibinder

我正在使用Gwt,

我有一个标签。在onClick活动中,有PopupPanel,添加了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;

}

1 个答案:

答案 0 :(得分:4)

为“documentClass-PopUp”

定义背景颜色
.documentClass-PopPup {
  background-color: white;
}

或使用

popupPanel.addStyleName("documentClass-PopPup");

而不是

popupPanel.setStyleName("documentClass-PopPup");