Image in GWT menubar instead of text
问题 I am using MenuBar from GWT showcase. I want to add text in the menubar. Can you please let me know that in which way I can get it ? 回答1: You can try this one also. Its given in MenuBar Docs API public MenuItem addItem(java.lang.String text, boolean asHTML, MenuBar popup) So, In your case, final String image = "<img src='"+GWT.getModuleBaseURL() + "/images/down-arrow.png' height='25px' width='25px'/>"; HomeMenu.addItem(new MenuItem(image,true,mainMenu)); 回答2: The best approach is not to hack