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

前端 未结 4 1366
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:24

    I was having exactly the same problem, and I also know that you asked specifically for a mouse listener to the checkbox editor, but a workarround might be adding a TableModelListener as described here under the section "Listening for Data Changes", and try to simulate the behavior when you detect the change, but if you want to know when the mouse is over the checkbox or things like that < specific actions of the mouse >, I'm affraid that you'll have to make yout own implementation of a cell Editor, which implements those behaviors... At least thats what I would do...

    Grettings!...

提交回复
热议问题