9.17. Enabling and Disabling Table Items

Problem

You want to gray out table items so that they can’t be selected.

Solution

Use the table item’s setGrayed method.

Discussion

To gray out a table item, call that item’s setGrayed method with a value of true; to enable the item again, pass the setGrayed method a value of false.

Get Eclipse Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.