The code is fairly straightforward, except perhaps for the call to convertColumnIndexToModel. That call is necessary because if the user moves the columns around, the view s index for the column doesn t match the model s index for the column. For example, the user might drag the Vegetarian column (which the model considers to be at index 4) so it s displayed as the first column — at view index 0. Since prepareRenderer gives us the view index, we need to translate the view index to a model index so we can be sure we re dealing with the intended column