Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWING JTable, cell start to edit event

Tags:

java

swing

jtable

I have a JTable and these cells of it are editable, there are any ways to handle the "cell start to edit" event in order that I can display a message when users start to edit a cell.

like image 992
Nessaj Nguyen Avatar asked Dec 19 '22 10:12

Nessaj Nguyen


1 Answers

If this were my code, I'd start by trying to override the TableEditor's getTableCellEditorComponent method. Inside of the override, I'd call the method that I want to call when editing starts, and then I'd call the super's getTableCellEditorComponent method inside the override.

You can find out more details on how to use custom cell editors (since this is what you need to do) at the JTable tutorial.

like image 74
Hovercraft Full Of Eels Avatar answered Dec 22 '22 00:12

Hovercraft Full Of Eels