0
private void Acc_Button_createActionPerformed(java.awt.event.ActionEvent evt) {                                                  

    int p = JOptionPane.showConfirmDialog(rootPane, "Do you want add", "Add", JOptionPane.YES_NO_OPTION);
    if (p == 0) {
        try {
            String sql = "insert into ACCOUNT_INFO  (ACC,NAMEF,DOB,PIN,ACCOUNT_TPAYE,NATIONALTY,CASTE,MICR_NO,GENDER,MOB_NO,ADDRESS,SEC_Q,SEC_A,BLANCE)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
            jrowSet.setCommand(sql);
            jrowSet.setString(1, Acc_TextField_acc.getText());
            jrowSet.setString(2, Acc_TextField_amunt.getText());
            jrowSet.setString(3, ((JTextField) Acc_DateChooser_birh.getDateEditor().getUiComponent()).getText());
            jrowSet.setString(4, Acc_TextField_pin.getText());
            jrowSet.setString(5, (String) Acc_ComboBox_acc_type.getSelectedItem());
            jrowSet.setString(6, (String) Acc_ComboBox_naton.getSelectedItem());
            jrowSet.setString(7, Acc_TextField_name.getText());
            jrowSet.setString(8, Acc_TextField_misr.getText());
            // for radio btn
            RadioButton_male.setActionCommand("Male");
            RadioButton_female.setActionCommand("Femal");
            // to insert radin in database
            jrowSet.setString(9, buttonGroup2.getSelection().getActionCommand());
            jrowSet.setString(10, Acc_TextField_caste.getText());
            jrowSet.setString(11, Acc_TextField_adrres.getText());
            jrowSet.setString(12, (String) Acc_ComboBox_sq_q.getSelectedItem());
            jrowSet.setString(13, Acc_TextField_mob_no.getText());
            jrowSet.setString(14, Acc_TextField_seq_a.getText());
            jrowSet.execute();
          // Bal();
            JOptionPane.showMessageDialog(rootPane, "added", "add acount", JOptionPane.INFORMATION_MESSAGE);

        } catch (HeadlessException | SQLException e) {
        }
    }
}

// Acc_Button_createActionPerformed(Account.java:414) >> this is the ine 414 
 jrowSet.setString(9, buttonGroup2.getSelection().getActionCommand());
2
  • what is your question?
    – Alexan
    May 27, 2017 at 15:21
  • not working this is the error Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.mo7amd.Account.Acc_Button_createActionPerformed(Account.java:414) and this is the line number 414 jrowSet.setString(9, buttonGroup2.getSelection().getActionCommand()); May 27, 2017 at 17:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.