Browse Source

Fix example in JavaDoc (#10758)

tags/8.4.0.alpha1
Anastasia Smirnova 6 years ago
parent
commit
8b2da456bd
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      server/src/main/java/com/vaadin/ui/Component.java

+ 4
- 4
server/src/main/java/com/vaadin/ui/Component.java View File

@@ -1012,22 +1012,22 @@ public interface Component extends ClientConnector, Sizeable {
* Sets the focus to this component.
*
* <pre>
* Form loginBox = new Form();
* FormLayout loginBox = new FormLayout();
* loginBox.setCaption(&quot;Login&quot;);
* layout.addComponent(loginBox);
*
* // Create the first field which will be focused
* TextField username = new TextField(&quot;User name&quot;);
* loginBox.addField(&quot;username&quot;, username);
* loginBox.addComponent(username);
*
* // Set focus to the user name
* username.focus();
*
* TextField password = new TextField(&quot;Password&quot;);
* loginBox.addField(&quot;password&quot;, password);
* loginBox.addComponent(password);
*
* Button login = new Button(&quot;Login&quot;);
* loginBox.getFooter().addComponent(login);
* loginBox.addComponent(login);
* </pre>
*
* <p>

Loading…
Cancel
Save