aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable displaying input data onto console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable displaying input data onto console" Watch "JTable displaying input data onto console" New topic
Author

JTable displaying input data onto console

Zaki Fahmi
Greenhorn

Joined: Sep 27, 2006
Posts: 2
Hi,

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.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
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.
Zaki Fahmi
Greenhorn

Joined: Sep 27, 2006
Posts: 2
Thanks a lot!!! It works perfectly.
 
 
subject: JTable displaying input data onto console