aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable JTextField value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable JTextField value" Watch "JTable JTextField value" New topic
Author

JTable JTextField value

Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Hello,
Is there a simple way to get the original value from the JTextField before the user updated it? If the cell contains a value of 10 and then the user updates the value to 35, how can I get back the 10? I'm guessing I have to store the original value before the user edits the cell?

Thanks for everyone's feedback.
Naga Malleshwararao
Greenhorn

Joined: Oct 22, 2006
Posts: 4
First you should be clear where 10 is actually stored. If 10 is in database you can fetch the value from the database and you can compare it with the updated value in textfield. If you 10 is generated at run time you have to store the 10 in a variable before updating.
Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Thanks Naga for your reply. The value is stored in the database, however I was hoping that perhaps JTextField or it's super had some functionality that stores the previous value. I've decided to store the value before the user edits it.

Thanks again.
-Shannon
 
 
subject: JTable JTextField value