0

So im doing this swing java gui project where the admin can login and search, modify and add users to the database mysql.

Im having trouble putting in the right getParameter to get:

type = radio group button of 2 with 1 as Doctor and 1 as Nurse
Specialty = a list of different doctor specialties such as Plastic Surgeon, Pediatrician and etc.

Am I setting the 'get' right? for type(radiogroup) and specialty(drop down list)
Line 4 and 9 respectively are where i get errors.

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                      
        int result = AddDoctorNurseQueries.addPerson( 
               
                type.getSelectedItem().toString(),
                lname.getText(), 
                fname.getText(), 
                username.getText(), 
                pass.getText(), 
                specialty.getSelectedItem().toString() );
      
      if ( result == 1 )
         JOptionPane.showMessageDialog( this, "Person added!",
            "Person added", JOptionPane.PLAIN_MESSAGE );
      else
         JOptionPane.showMessageDialog( this, "Person not added!",
            "Error", JOptionPane.PLAIN_MESSAGE );
          
    }
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Ezzaral
0

> Line 4 and 9 respectively are where i get errors.
You should post the stack traces for those errors instead of expecting people to guess what they are.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.