File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes How to Detect Changed values??......Urgent !!!  Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "How to Detect Changed values??......Urgent !!!  " Watch "How to Detect Changed values??......Urgent !!!  " New topic
Author

How to Detect Changed values??......Urgent !!!

RAO AP
Greenhorn

Joined: Dec 01, 2001
Posts: 3
Hi Gurus,
I have a problem with Jtable, Ho do i compare
old data(before User Changes) at 1st Row,1st Cloumn
with new data(After User Changes)1st Row,1st Column,I Used
TableModelEvent... valueChanged().. but I can't get the solution
please help me...
Thanks in advace..

punnna
------------------
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Look at the DefaultTableModel. There is a setValueAt() method that changes the value. At that point the value passed in is the new value. You can do a getValueAt() to get the current value.
RAO AP
Greenhorn

Joined: Dec 01, 2001
Posts: 3
Hi Paul.
Thax It works.. I have a problem with TAB key ..pls go through this.
I Set Maximum Length at Column 1, It works fine.. But After
Pressed "TAB-KEY" The control is off..means its taking exceeds
Maximum Length. And I can't Identify If "TAB-KEY" Pressed.
Here is my code...
if (evt.getKeyCode() == KeyEvent.VK_DELETE)
System.out.println("DELTE KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_RIGHT)
System.out.println("RIGHT KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_LEFT)
System.out.println("LEFT KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_SHIFT)
System.out.println("SHIFT KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_HOME)
System.out.println("HOME KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_END)
System.out.println("END KEY IDENTIFIED !");
else if (evt.getKeyCode() == KeyEvent.VK_TAB)
System.out.println("END TAB PRESSED !");
thax in advance
Originally posted by Paul Stevens:
Look at the DefaultTableModel. There is a setValueAt() method that changes the value. At that point the value passed in is the new value. You can do a getValueAt() to get the current value.

 
 
subject: How to Detect Changed values??......Urgent !!!
 
Threads others viewed
How To compare two excel sheets using java
sending updated array of javaBeans from JSP back to Servlet!
JTable � handle Row lost focus event
Updating DB from JSP
how to implement Concurrent access to records..Please help me URGENTLY
IntelliJ Java IDE