Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
CssImport when using Component Exporter by Mikhail Shabarov, 7 months ago
Struggling with button size!
Hi,
I keep struggling with setting the size of a button.
I've square icons (e.g. 32x32px) that I want to use in the setIcon method of the Button component. Setting the icon works okay, but how can I make the button be square in size e.g. 40x40px, with the icon centered?
Setting the height and width using setHeigth and setWidth does't seem to work! Currently using version 7.5.9!
Any idea how to tackle this issue?
Regards,
Gerard
Last updated on
This should do it (using the Valo theme).
Button btn = new Button();
btn.setIcon(FontAwesome.CHECK);
btn.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
btn.setHeight("40px");
btn.setWidth("40px");
Last updated on
You cannot reply to this thread.