Selecting items in tables
Tables can listen to clicks on rows. What you need to do is to add an ItemClickListener
method to the table:
table.addItemClickListener(this);
Because we are passing a reference to our UI
class (this
), we must implement ItemClickListener
in our
BoxwordsUI
class:
public class BoxwordsUI extends UI implements ItemClickListener { public void itemClick(ItemClickEvent event) { } }
The itemClick
method will be called every time the user clicks on a table row. Let's add that behavior right away.