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.
Change Grid Header Name
So from the tutorial we have a grid with "First Name", "Last Name" and so on as grid column hader name. The question is, how exactly, I can rename them?
I have tried things like:
grid.getDefaultHeaderRow().getCell("firstName").setHtml("The <u>amount</u>");
or
grid.getColumn("First Name").setHeaderCaption("Name");
and so on.
And evry time I got
NullPointerException
.
As I understand, I didn't pass right column name to the grid get?
Please Help!
You should use the following format.
grid.getColumn("myPropertyName").setHeaderCaption("My Caption");
The "myPropertyName" should match the getters and setters of the POJO / Bean which you use in the datasource container.
I.e. you should have this in your bean
bean.getMyPropertyName() { ... }
I hope this clarifies the thing.