I created a custom editor that inherits from DefaultCellEditor and overrides
isCellEditable that checked whether the EventObject is of type MouseEvent. I
call super(new JTextField()) and setClickCountToStart(2) in its constructor
and do this:

table.setCellEditor(new CustomCellEditor());

But it never seems to invoke the isCellEditable method. I have a System.out
there, it is never called. Any idea why?

-----Original Message-----
From: Iv�n [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 9:25 AM
To: [EMAIL PROTECTED]
Subject: Re:Editing a JTable cell on double-click


> Message: 2
> From: "Reinstein, Lenny" <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'"
> <[EMAIL PROTECTED]>
> Subject: Editing a JTable cell on double-click.
> Date: Tue, 19 Mar 2002 17:49:42 -0500
> 
> I want to achieve this:  When the user double-clicks
> a particular cell in
> the JTable, it becomes editable. What is the easiest
> way to do it?
> MouseListener listenes to double click, while the
> isCellEditable in the data
> model determines whether the cell is editable or
> not. How can I connect the
> two? 
> 
> Many thanks!

The cell will begin to edit with the number of clicks
that the method getClickCountToStart returns. Before
you have the instance of the CellEditor, you have to
call setClickCountToStart (2) and you will have what
you want.

Regards

_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicaci�n instant�nea gratis con tu gente.
http://messenger.yahoo.es
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to