David Serio wrote:
Not working:
Error:
.\ItemTable.java:23: 'void' type not allowed here
iTable.addColumn((new TableColumn()).setHeaderValue("Item"));
1 error
You're trying to chain your methods in a way that is not possible. If setHeaderValue(...) returned the TableColumn object that is calling this method, then you're golden, but if you go to the TableColumn API and look up the setHeaderValue() method, you'll see that it doesn't, it returns void. So what you are doing here is by trying to save a few lines you end up trying to pass void as the parameter to your addColumn method, and this just won't work.
Solution: just don't do it.