-2
final DecoratedPopupPanel infoPopup = new DecoratedPopupPanel(true);
    infoPopup.setWidget(new Label("Table below displays the total number of users for each application for the selected time range."));
    infoPopup.setWidth("150px");

    inImage.addMouseOverHandler(new MouseOverHandler(){
        public void onMouseOver(MouseOverEvent arg0){
            int left = inImage.getAbsoluteLeft() + 10;
            int top = inImage.getAbsoluteTop() + 10;
           infoPopup.setPopupPosition(left, top);

            // Show the popup
            infoPopup.show();
        }

    });

    inImage.addMouseOutHandler(new MouseOutHandler(){
        public void onMouseOut(MouseOutEvent arg0){
           //hide
            infoPopup.hide();

        }
    });
4

1 回答 1

0

您可以通过使用 CSS 创建自己的自定义样式来实现它。

默认DecoratedPopupPanel使用clean.cssgwt-DecoratedPopupPanel中定义的样式。

.gwt-DecoratedPopupPanel .popupMiddleCenter {
    padding: 3px;
    background: #f1f1f1;
}

创建您自己的样式,只需更新背景颜色属性并在其上应用样式,如下所示:

CSS:

.myPopupPanelStyle {
  background: #0000FF;
}

爪哇:

infoPopup.setStyleName("myPopupPanelStyle");
于 2014-05-23T16:00:01.083 回答