how to add a mouse listener to a JTable's cell holding a Boolean value rendered as checkbox

前端 未结 4 1352
Happy的楠姐
Happy的楠姐 2020-12-11 06:16

I have a JTable with a custom model implemented extending AbstractTableModel.

public abstract class AbstractTable extends AbstractTableModel{

     public Cl         


        
4条回答
  •  伪装坚强ぢ
    2020-12-11 06:28

    Seems like adding a mouse listener is an extra step. I would suggest intercepting the change in the setValue() method of the model.

    If you can't change the setValue() method then the next best thing is a CustomEditor that will block changes because this is not a good way to catch and hide the mouse click even from the default boolean editor.

提交回复
热议问题