hi,
i have created 7 textfields and a save button. i want to validate each textfield. the scenario is if any textfield is null or left blank i should get the message box "xyz field should entered" when the save button is clicked.
example,
i've tried this code,but its not working,
regards,
Vignesh Karthick
i have created 7 textfields and a save button. i want to validate each textfield. the scenario is if any textfield is null or left blank i should get the message box "xyz field should entered" when the save button is clicked.
example,
Code:
"class save extends JPanel {
public save() {
JButton save = new JButton("Save");
add(save);
save.addActionListener(new JDBC());
}
}"
" String exe = "insert into kics.dateframe(date,style,description,fabricgsm,agegroup,size,measurementsunits)values('" + componentTextField.getText() + "','" + TFstyle.getText() + "','" + TFdescription.getText() + "','" + TFfabricGSM.getText() + "','" + TFagegroup.getText() + "','" + TFsize.getText() + "','" + TFmeasurements.getText() + "')";
stmt.executeUpdate(exe);
i've tried this code,but its not working,
Code:
if (exe != null) {
stmt.executeUpdate(exe);
} else {
JOptionPane.showMessageDialog(null, "xyz fields should be entered");
}"
regards,
Vignesh Karthick
Comment