• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Editing in a JTable

 
Russell Peters
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable with its associated table model and a table model listener. I have 3 columns in it and columns 2 & 3 are editable. When the user edits column 2, I would like to access the new value that the user entered for validation purposes and if valid I update the table else throw an error dialog. I tried the , but this gives me the value that was originally there not the new value.

Currently, I have it implemented as a non editable column and the user clicks the 'Edit' button which shows up a , and therefore I have a handle to the new value.

But now I wish to get rid of the 'Edit' button altogether and make the column editable within the table itself.

Can someone help me with this?

Thanks in advance
[ August 03, 2006: Message edited by: Russell Peters ]
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Russell Peters
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked like a charm !!!


Thanks Craig,

Russell
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic