2014-05-23 1 views
-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(); 

     } 
    }); 

답변

0

CSS를 사용하여 자신 만의 스타일을 만들어서 구현할 수 있습니다.

기본적으로 DecoratedPopupPanelgwt-DecoratedPopupPanel 스타일은 클리어.css에 정의되어 있습니다.

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

자신 만의 스타일을 만들고 단지 배경 색상 속성을 업데이트하고 아래와 같이에 스타일을 적용

CSS :

.myPopupPanelStyle { 
    background: #0000FF; 
} 

JAVA :

infoPopup.setStyleName("myPopupPanelStyle");