Add a line with pure java

How can i add in vaadin 12 a line with pure java?

something like:

public class MyClass extends FormLayout {
	public MyClass {

Hello Hans-georg,

You can create it, this way:

Div line = new Div();
line.getStyle().set("width","100%").set("border-top","4px solid red");


You can also create a custom component so you can use it many times:

import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.html.Div;

public class Line extends Div {
    public Line() {
        getStyle().set("width","100%").set("border-top","4px solid red");