aspose file tools
The moose likes Swing / AWT / SWT and the fly likes How to detect change in JTable cell without leaving the cell and enterin another  one Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to detect change in JTable cell without leaving the cell and enterin another  one" Watch "How to detect change in JTable cell without leaving the cell and enterin another  one" New topic
Author

How to detect change in JTable cell without leaving the cell and enterin another one

Apirak Panatkool
Greenhorn

Joined: Apr 30, 2002
Posts: 15
How to detect change in JTable cell without leaving the cell and entering another one. In other words, cell won't get updated if you just leave JTable and go to another component (losing focus). It only get updated if you leave the cell by clicking on another cell.


bAnk
Apirak Panatkool
Greenhorn

Joined: Apr 30, 2002
Posts: 15
In a JTable, if you are editing the (last cell on the) last line, when you hit return nothing happens. It's wanting to move the cursor down a row and it can't, so even though it looks like you've made the change it hasn't actually gone through to the underlying table data.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Apirak,
You can programmatically move the editing cell to some other cell and then back again. Visually nothing changes and the table model gets updated with the user none the wiser.
Something like the following should work in most cases:

Regards,
Manfred.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to detect change in JTable cell without leaving the cell and enterin another one
 
Similar Threads
JDateChooser in JTable
JTable editing
JTable
JComboBox as Cell renderer in JTable
JTable(!!!)