构建一个Vaadin Flow web应用程序,用Java编写。
package com.example;
import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.router.Route;
@Route
public class MainView extends VerticalLayout
{
public MainView()
{
Button button = new Button( "Do something" );
addButton.addClickListener(
click -> {
… your Java code goes here, to execute server-side, in JVM.
}
);
this.add(
button
);
}
}