• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable editting  RSS feed

 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!