Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.65 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Display an image in a GWT Button with IE8
  2. setHTML("<img src=""+image.getURL()+"" />"+someText);
  3.        
  4. if (Navigator.getUserAgent().matches(".*MSIE.*")){
  5.     this.setStyleName("ieButton");
  6.     setHTML(someText);
  7. }
  8.        
  9. .ieButton {
  10.     background: transparent url('../img/connect.png') no-repeat;    
  11. }
  12.        
  13. if (Navigator.getUserAgent().matches(".*MSIE.*")){
  14.     String imageName;
  15.     String extension;
  16.     int begin;
  17.     begin = imgr.getURL().lastIndexOf(".");
  18.     extension = imgr.getURL().substring(begin);
  19.     imageName = imgr.getName()+extension;
  20.     this.getElement.getStyle().setProperty("background", "url(''../img/"+imageName+"'')");
  21.     setHTML(someText);
  22. }