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.
How to make a Label look like a TextField?
Hi.
How can I make my label look exactly like a TextField? Ideally I don't want to create a new style but use existing one instead. So that if default TextField style is changed then my label would get changes as well.
For now I'm using:
someLabel.addStyleName("v-textfield");
and that gives me the background color, borders and font. But for example padding settings are missing.
Any ideas, please?
You might have more luck putting a TextField.setReadOnly(true) and modifying v-textfield.v-readonly style.
That's exactly what I need and what I started with, but it turns out that read-only disabled TextField doesn't work reliably with LayoutClickListener so as a workaround I'm trying to make a dummy text fields out of customised Labels.
EDIT: I mean disabled not read-only.