Ialberquilla
Ialberquilla

Reputation: 133

TableModelListener event from keyboard

I Have a Jtable where a TableModelListener is listening

Implemented by

private void anadeListenerAlModelo() {
    tabla.getModel().addTableModelListener(new TableModelListener() {
        @Override
        public void tableChanged(TableModelEvent evento) {
            if (evento.getType() == TableModelEvent.UPDATE) {
                System.out.println("Editing...");
            }
        }
    });
}

And I want to detect when a cell is being edit but only if is edit from de keyboard, because, other events could update the content.

I only need when the user is editing a cell from the keyboard. It's this posible?

Thanks!

Upvotes: 0

Views: 110

Answers (1)

camickr
camickr

Reputation: 324207

Check out the Table Cell Listener.

It listens for PropertyChange events on the table for when the cell editor is activated/deactivated and then notifies you when the data in the cell has actually been changed.

Upvotes: 2

Related Questions