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.
VAADIN's AbstractLayout, the parent of Horizontal and VerticalLayouts, contains methods to add components to the back and in front of existing ones, but not in the middle of them. It should be pretty obvious how to perform this task, but it is not. Once a component is moved to another layout it is removed from the original, so an iteration will not work as the list of components changes in size in each iteration.