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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
label.setCaption com comportamento estranho
Estou fazendo testes básicos.
Quando crio um label com um caption, e depois altero o caption, na tela aparecem duas linhas.
Qualquer ajuda seria de muito valor
Programa abaixo:
package com.example.myproject;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import java.io.*;
@SuppressWarnings("serial")
@Theme("runo")
public class MyprojectUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyprojectUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
Label label = new Label ("____________");
label.setCaption("============");
layout.addComponent (label);
}
}
Olá Paulo,
O método setValue modifica o texto do Label.