I have a created a simple 3X3 JTable and I would like to add a listener so that when a user inputs data (for example a number) into any cell, the data gets printed onto the ide console (like when you print out Hello World! to the console/screen).
Also when the user goes onto another cell to input data that also appears on the console.
Example: Cell 1 user inputs 2563, and then on cell 2 inputs 01 it appears as: 2563 01
I have tried using this simple code but it results in an error
Any simple example to make this work will be greatly appreciated, Thanks.
If you want to get involved in the editing process you could work with an editor listener. To simply print out the change you could add a listener to the TableModel which is apprised of all successful edits to the table.
Joined: Sep 27, 2006
Thanks a lot!!! It works perfectly.
subject: JTable displaying input data onto console