I have 4 columns JTable using Default table model, i am populating two column's from DB, and user have to fill the purchase price and sale price in jTable , i wanna make sale Price cannot be greater than Mrp Please Help me..
Asked
Active
Viewed 110 times
0
-
1Add a listener to the table and use that to check the entered values at the appropriate moment. – Dominik Sandjaja Feb 15 '13 at 12:49
-
1Extend `DefaultTableModel` and override `setValueAt()` to validate the user input. – Guillaume Polet Feb 15 '13 at 13:08
-
1For [example](http://stackoverflow.com/a/13628183/230513). – trashgod Feb 15 '13 at 13:41
-
Use a custom editor on the Sales Price column. See: http://stackoverflow.com/questions/6913767/jtable-alert-on-invalid-value/6914552#6914552. – camickr Feb 15 '13 at 16:44
1 Answers
1
In what problem? Can you show any relative code? Any way I recomend you write your custom table model extends DefaultTableModel (http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/DefaultTableModel.html), it's more flexible.

slawter
- 525
- 4
- 14
-
-
You could make this a better answer by adding a link to the related `JTable` tutorial section. – Catalina Island Feb 15 '13 at 14:11