0

I'm making my first program that is JavaBeans and i have problem. My program is reading some data from files and puting in JTable. Problem is that some of data can be editable and when user will edit some cell i want to fire fireVetoableChange to check if new value is proper is not i want to set previous. Where I should do this ? Should I add fireVetoableChange at method getValueAt from TableModel? And if value is wrong how can i put previous value ? Please help me. It's very important for me but i cannot find any answers.

mKorbel
  • 109,107
  • 18
  • 130
  • 305
mefmund
  • 1
  • 2
  • You have two choices, either supply TableCellEditors capable of validating the data or validate the data via the setValueAt method – MadProgrammer Apr 08 '14 at 21:20
  • Ok, can you say little more ? How to use Table Cell Editors.. ? – mefmund Apr 08 '14 at 21:21
  • See [how to use tables](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html) - also note that if you want to use votoable change support, you'll need to add the support yourself – MadProgrammer Apr 08 '14 at 21:34
  • Possible duplicate of http://stackoverflow.com/questions/16224777/cell-validation-in-jtable – MirroredFate Apr 08 '14 at 22:01

0 Answers0