Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Validating jtable cells with different editors  RSS feed

 
anuma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am having a rich jtable of 6 columns with different column cell editors of checkbox,combo,custom control, textfield etc. I need to validate all the cells on lost focus of the cells(tab or mouse) and put back the cursor to the table cells if not valide.
I am struggling a lot with this. Can anyone guide how to professionally validate table cells?
thanx in advance.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know about the way you are trying but you can do it with your own table model and override the setValueAt().
 
anuma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
the problem with this approach is
it is lostfocus validation. so, if the validation depends on the nextfocusable component, i cannot avoid the validation. For example when i press 'cancel' button of the screen i shouldn't validate the field value.
thanx in advance.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!