O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Headers

What if we want to change the header of a column at runtime? This couldn't be more easier:

table.setColumnHeader("Column 1", "There you have, a new header");

In the preceding line of code, the first parameter is the property ID for the column, and guess what! The second parameter is the new header text. You can change all headers with a single call:

table.setColumnHeaders(new String[] {"Header 1", "Header 2"});

Are you interested in getting an array with the current column headers? There you go:

String[] columnHeaders = table.getColumnHeaders();

Maybe just the header for one particular column:

String columnHeader = table.getColumnHeader("Column 1");

You must provide the property ID of the desired column in the previous call.

Would you like to build ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required