Last active
February 14, 2017 12:16
-
-
Save tsuoanttila/5179da30b5a6436a13b0ee9c7020eae9 to your computer and use it in GitHub Desktop.
Password field in window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VerticalLayout layout = new VerticalLayout(); | |
usernameField = new TextField("Username:"); | |
layout.addComponent(usernameField); | |
passwordField = new PasswordField("Password:"); | |
layout.addComponent(passwordField); | |
Button login = new Button("Login"); | |
login.setClickShortcut(KeyCode.ENTER, null); | |
login.addClickListener(e -> Notification.show( | |
usernameField.getValue() + ":" + passwordField.getValue())); | |
layout.addComponent(login); | |
Window window = new Window(); | |
window.setContent(layout); | |
addWindow(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment