I want to implement a general validation class for my jtables in different forms to check the qty column , as the qty column No in different tables of different forms is different. For this i want to get the column value by column Name similarly in C# or VB.
My requirement is as follows.
int qty=jtable.getValueAt(rowNo,"columnName");
Now i am using
int qty=jtable.getValueAt(rowNo,colNo);
Is there any way to find column # by column Name or Header Of JTable?
You should try using this:
int qty = jtable.getValueAt( rowNo, jtable.getColumn("columnName").getModelIndex() );