JTable, edit a cell, but changed value not seen

  • Follow


I have a problem with using JTable, editing a cell in a row and then
expecting that edited cell data to automatically show up via
tblDisplay.getValueAt(row, i);  Just to be clear, tblDisplay is of class
JTable.

The problem shows up when you edit a cell but don't tab away from the cell.
It's like the edited cell data doesn't "stick".  What can I do to handle
this? Anything?  I have an issue where the last cell in a selected row is
edited and then the user selects the "Update" button to save the changes.
The Update button is coded to grab data from the selected row and save the
data.  The problem is the last cell is never seen, unless the user tabs
away. But tabbing away means selecting the next row.  So now the user is on
the wrong row, so they must tab back.  Aaaarrrgggh!!!

I would appreciate some help,
-Fred


0
Reply Fred 9/16/2004 1:57:30 AM

Fred wrote:
> I have a problem with using JTable, editing a cell in a row and then
> expecting that edited cell data to automatically show up via
> tblDisplay.getValueAt(row, i);  Just to be clear, tblDisplay is of class
> JTable.
> 
> The problem shows up when you edit a cell but don't tab away from the cell.
> It's like the edited cell data doesn't "stick".  What can I do to handle
> this? Anything?  I have an issue where the last cell in a selected row is
> edited and then the user selects the "Update" button to save the changes.
> The Update button is coded to grab data from the selected row and save the
> data.  The problem is the last cell is never seen, unless the user tabs
> away. But tabbing away means selecting the next row.  So now the user is on
> the wrong row, so they must tab back.  Aaaarrrgggh!!!
> 

This is a rather complicated problem - I suggest you refer to an 
excellent discussion on this at :

http://www.mycgiserver.com/~Kleopatra/swing/swingentry.html

BK

0
Reply Babu 9/16/2004 4:14:58 AM


Thanks BK. That is exactly what I'm seeing.  I will try the new table
property and see how it goes.
This isn't the first time Jeanette has saved the day.  Props to Jeanette!
-Fred

"Babu Kalakrishnan" <k.a.l.a@sankya.com> wrote in message
news:2qsifcF11ictkU1@uni-berlin.de...
> Fred wrote:
> > I have a problem with using JTable, editing a cell in a row and then
> > expecting that edited cell data to automatically show up via
> > tblDisplay.getValueAt(row, i);  Just to be clear, tblDisplay is of class
> > JTable.
> >
> > The problem shows up when you edit a cell but don't tab away from the
cell.
> > It's like the edited cell data doesn't "stick".  What can I do to handle
> > this? Anything?  I have an issue where the last cell in a selected row
is
> > edited and then the user selects the "Update" button to save the
changes.
> > The Update button is coded to grab data from the selected row and save
the
> > data.  The problem is the last cell is never seen, unless the user tabs
> > away. But tabbing away means selecting the next row.  So now the user is
on
> > the wrong row, so they must tab back.  Aaaarrrgggh!!!
> >
>
> This is a rather complicated problem - I suggest you refer to an
> excellent discussion on this at :
>
> http://www.mycgiserver.com/~Kleopatra/swing/swingentry.html
>
> BK
>


0
Reply Fred 9/16/2004 5:46:45 AM

2 Replies
401 Views

(page loaded in 0.057 seconds)

Similiar Articles:













7/29/2012 5:17:34 AM


Reply: