Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
RAO AP
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!