• 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

JTable editting

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm doing the editting in the cells of my JTable. I've got everything working fine except for one annoying feature. The database is not updated until the user clicks on a different row. If the user updates a row and then clicks on exit instead of another row, the last update is lost! Is there a way I can make it do this when the row loses focus?
ms
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately it looks like the action/event, or update won't occur till you leave the row. Now what kind of Listener are you using. Is it possible that there might be a better Listener that will let you know something has changed in the cell without having to go to another row? You could try around.
Personally I didn't think it was necessary to have the user make the changes directly in the JTable. I'm not saying it isn't a nice feature.
I just had a JTextField and a JButton below the JTable for them to do their booking.
Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic