Hello Everyone! am new in java programming and am having Illegal Start of Expression here if( StudentID == 0), any idea on how i can resolve this error?
Thanks in advance.
Chris
public void SaveandNewStudents(){ StudentID = Integer.parseInt(txtstudentID.getText()); FirstName =txtStudentFname.getText(); LastName =txtStudentLName.getText(); Room = Integer.parseInt(txtRoom.getText()); DateOfBirth = Integer.parseInt(txtDateOfBirth.getText()); ZIPPostalCode =Integer.parseInt(txtpostalcode.getText()); Company =txtcompany.getText(); GuardianFirstname =txtguardianFname.getText(); GuardianLastname = txtguardianLname.getText(); GuardianE_mail = txtguardianemail.getText(); WebPage =txtwebpage.getText(); E_MailAddress =txtemail.getText(); Level = Notes =txtArea.getText(); Sex = Attachments = Street = txtstreet.getText(); City =txtcity.getText(); StateProvince =txtstateprovince.getText(); CountryRegion =txtcountry.getText(); GuardianRelationship = PhysicanName = txtphysicianname.getText(); Allergies = txtAllergies.getText(); Medications = txtMdeications.getText(); EmergencyContactName = txtemegencycontactname.getText(); EmergencyContactRelationship = [COLOR="#0000FF"] if( StudentID == 0) {[/COLOR] JOptionPane.showMessageDialog(rootPane, "Please enter StudentID."); } else{ try{ BusinessPhone = Integer.parseInt(""+txtbusinessphone.getText()); HomePhone = Integer.parseInt(""+txthomephone.getText()); MobilePhone = Integer.parseInt(""+txtmobilephone.getText()); FaxNumber = Integer.parseInt(""+txtfaxnumber.getText()); PhysicanPhoneNumber = Integer.parseInt(""+txtphysicianphonenumber.getText()); EmergencyContactPhone1 =Integer.parseInt(""+txtemergencyphonenumber1.getText()); EmergencyContactPhone2 = Integer.parseInt(""+txtemegencyphonenumber2); //create a StudentsInfo object and pass it to StudentsDAO to save it StudentsInfo Students = new StudentsInfo(); StudDAO.saveStudents(Students); }catch (Exception e){ System.out.print("Input is a string"); JOptionPane.showMessageDialog(rootPane, "Please enter Phone Number. "); } } }[LIST=1][/LIST]