Is there a way to setPadding on GWT HorizontalPanel.
I wanted to just have 20px left padding and then add few buttons.
Currently I can only add setSpacing() and that puts padding on top,left,right,bottom.
-Thanks in advance!!
Is there a way to setPadding on GWT HorizontalPanel.
I wanted to just have 20px left padding and then add few buttons.
Currently I can only add setSpacing() and that puts padding on top,left,right,bottom.
-Thanks in advance!!
You could (and should) use CSS for this, something like:
.paddedHorizontalPanel {
padding-left: 20px;
}
And if you want every Button
in that HorizontalPanel
to be 20px
apart, then you can try this instead:
.paddedHorizontalPanel .gwt-Button {
margin-left: 20px;
}
And then add this style to you HorizontalPanel
via hPanel.addStyleName("paddedHorizontalPanel");
More on CSS and GWT in the docs.
PS: AFAIK, not including setPadding was a concious choice on part of the GWT team - they wanted to leave the styling of the application entirely up to CSS.