<dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-bom</artifactId> <version>14.1.21</version> <type>pom</type> <scope>import</scope> </dependency> import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.ButtonVariant; import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.router.Route; @Route("") public class MyButtonView extends Div { public MyButtonView() { Button button = new Button("Click me"); button.addClickListener(event -> { Notification.show("Button clicked!"); }); add(button); } } Button button = new Button("Click me"); button.addClickListener(event -> { Notification.show("Button clicked!"); }); button.addThemeVariants(ButtonVariant.LUMO_PRIMARY, ButtonVariant.LUMO_SUCCESS);


上一篇:
下一篇:
切换中文