• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tableChanged event of TableModelListener

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am having problem in retrieving data from InteractiveTableModel. Code is like below (part of entire code)



I have one button to print content of table. When I enter the value in table cell and without pressing Enter Key if I click print button I found that content of a cell which is having focus at present is not getting retrieved. I also noticed that tableChanged method is not being called while wevkey in values in cell.

Please let me know how to get rid of this problem.

Thanks
Peter


 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

James Peter wrote:When I enter the value in table cell and without pressing Enter Key if I click print button I found that content of a cell which is having focus at present is not getting retrieved.


Call where table is the variable referring to your JTable. That will cause the cell editing to stop (terminate) whenever the JTable loses focus, like when a button is pressed.

I also noticed that tableChanged method is not being called while wevkey in values in cell.


That's because the table cell editor hasn't committed its current value to the JTable yet. It won't until you press Enter, or until you "flush" the data to the TableModel manually (using setValueAt).
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

It really worked. thanks a lot.


Peter
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
reply
    Bookmark Topic Watch Topic
  • New Topic