HorizontalLayout remove spacing

public HorizontalLayout tool() {
HorizontalLayout p = new HorizontalLayout();
p.setSpacing(true);
p.setWidth(“600px”);
p.setHeight(“50px”);
Button ad = new Button(“”);
Button de = new Button(“”);
Button ed = new Button(“”);
ad.setIcon(FontAwesome.BANK);
de.setIcon(FontAwesome.DOWNLOAD);
ed.setIcon(FontAwesome.EDIT);
p.addComponent(ad);
p.addComponent(ed);
p.addComponent(de);
p.setComponentAlignment(ad, Alignment.MIDDLE_RIGHT);
p.setComponentAlignment(ed, Alignment.MIDDLE_RIGHT);
p.setComponentAlignment(de, Alignment.MIDDLE_RIGHT);
return p;
}
16810.png

this post could help you

https://vaadin.com/forum#!/thread/1879087

Like so?

HorizontalLayout p = new HorizontalLayout();
p.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
p.setSpacing(true);
p.setWidth("600px");
p.setHeight("50px");

Button ad = new Button(FontAwesome.BANK);
Button de = new Button(FontAwesome.DOWNLOAD);
Button ed = new Button(FontAwesome.EDIT);

p.addComponents(ad, ed, de);
p.setExpandRatio(ad, 1f);
return p;