java - Vaadin: Remove caption from menu item -


i have menu bar items.i want each item display it's icon.so how can remove caption each item? have:

menubar actionbar = new menubar(); menubar.additem(translator.getstring("home"),vaadinicons.home,(selecteditem)  -> getui().home()); menuitem user= menubar.additem(aspirinsession.getcurrent().getcurrentuser().getdisplayname(),  vaadinicons.menu, null); menubar.addstylename(valotheme.menubar_borderless); 

enter image description here

either setcaption("") on buttons or not add caption in fist place:

menubar.additem("", vaadinicons.home ,(selecteditem) -> getui().home()); menuitem user= menubar.additem("", vaadinicons.menu, null); 

that should trick.

you can play around buttons on demo page (hit "edit" on right). or maybe check css approach here, still allow add text button.


Comments