I'm currently working with Gwt and have encountered a problem with styling buttons.
Let's take a look at the following code snippet:
.marginRight{
margin-right: 10px;
}
FlowPanel myFP=new FlowPanel();
Button myButton=new Button("Button");
Button myButton2=new Button("Button2");
myButton.addStyleName("marginRight");
myFP.add(myButton);
myFP.add(myButton2);
When this code runs, there is no gap between myButton
and myButton2
.
Note: The Button
component in Gwt has a default style applied to it. This might be causing the issue of the missing margin. Adding a Label to the FlowPanel seems to work fine, but PushButton doesn't recognize the margin properly, so it's likely not an issue with the gwt-button style itself.
This is the corresponding JavaScript code for the above Gwt code:
<div><button class="gwt-Button GHKUF0UDD4" type="button">Button</button><button class="gwt-Button" type="button">Button2</button></div>
Do you have any insights on why this is happening and potential solutions to fix it?