private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) /Button Click/
{
DefaultTableModel dt=(DefaultTableModel) jTable1.getModel(); /Table Model /
String tn=jname.getSelectedItem().toString();
String jf=jfrom.getSelectedItem().toString();
String jt=jto.getSelectedItem().toString();
String jm=jtime.getText();
String Data[]={tn,jf,jt,jm};
dt.addRow(Data);
}
This is my code for pressing ADD Button. when i press add the duplicate values are also added in new row. i want only new values to be stored in new row and want to show the error if the same values are inputted.
Can someone kindly help me with this? will there be a loop or some function? Please Help!