Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Difference between addComponent() and getContent().addComponent()?

Konrad Höffner
10 years ago Mar 22, 2012 11:22am

Is there a difference between addComponent(x) and getContent().addComponent(x)?

Example:

public class X extends Form
{
...
 public void doSomething()
 {
  setContent(new HorizontalLayout());
  addComponent(new Button("button 1"));
  getContent().addComponent(new Button("button 2"));
 }
}
Last updated on Mar, 22nd 2012
Teppo Kurki
10 years ago Mar 22, 2012 12:33pm