Specifically if I have:
FormLayout formLayout = new FormLayout();
formLayout.add(new TextField("Label goes here"));
And instead of a FormLayout I want to use a VerticalLayout but have the same style of Labels for the fields.
VerticalLayout verticalLayout = new VerticalLayout();
Label label = new Label("Label goes here");
verticalLayout.add(label);
// setLabelStyleSameAsLabelForTextFieldInFormLayout();
In other words what code would replace the method setLabelStyleSameAsLabelForTextFieldInFormLayout()?
Important -> I'm trying to do it in such a way that doesn't involve creating CSS so that it's more future proof. That is to say if the Label in the FormLayout is updated then so is the label in the VerticalLayout.
I have difficulties to understand the question. But this should be trivial by using
setLabelor label set by constructor of theTextField.. So the following should produce the label which looks the same.