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.
setComponentAlignment is used to align the whole component inside the layout. E.g. if you have a wide component beside a smaller component, the smaller component can be aligned to the right side of the wider component.
For text alignment, you need CSS. Add a custom style name for the text field (e.g. addStyleName("align-right")), and then in your custom theme CSS, write the following: