When I was compiling and running my program yesterday I wasn't receiving any warnings then when I compile and run it today I'm now receiving warnings, can someone help me solve this problem, I have pasted the code and warnings.
public CarInsuranceCalc() { // CarInsuranceCalc method super("Car Insurance Price Index Calculator"); // setting layout setLayout(new FlowLayout()); // label for gender lblGender = new JLabel("Gender:"); add(lblGender); // combobox for gender cboGender = new JComboBox(Gender); cboGender.setSelectedItem(null); // sets default value cboGender.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent event) { // sets combobox value equals selected value if(event.getStateChange()==ItemEvent.SELECTED) { // sets variable value to selected value strGender = String.valueOf(cboGender.getSelectedItem()); if(strGender=="Male" && strAge!=null) { dblRate = MaleRate[cboAge.getSelectedIndex()]; } if(strGender=="Female" && strAge!=null) { dblRate = FemaleRate[cboAge.getSelectedIndex()]; } } } // end of event handler } ); // end of listener add(cboGender); // label for age lblAge = new JLabel(" Age:"); add(lblAge); // combobox for age cboAge = new JComboBox(Age); cboAge.setSelectedItem(null); // sets default value cboAge.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent event) { // sets combobox value equals selected value if(event.getStateChange()==ItemEvent.SELECTED) { // sets variable value to selected value strAge = String.valueOf(cboAge.getSelectedItem()); if(strGender=="Male") { dblRate = MaleRate[cboAge.getSelectedIndex()]; } if(strGender=="Female") { dblRate = FemaleRate[cboAge.getSelectedIndex()]; } } } // end of event handler } ); // end of listener add(cboAge); // label for no claims lblNoClaim = new JLabel(" No Claims:"); add(lblNoClaim); // combobox for no claims cboNoClaim = new JComboBox(NoClaim); cboNoClaim.setSelectedItem(null); // sets default value cboNoClaim.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent event) { // sets combobox value equals selected value if(event.getStateChange()==ItemEvent.SELECTED); { // sets variable value to selected value strNoClaim = String.valueOf(cboNoClaim.getSelectedItem()); dblNoClaimDiscount = NoClaimDiscount[cboNoClaim.getSelectedIndex()]; } } // end of event handler } ); // end of listener add(cboNoClaim); btnCalculate = new JButton("Calculate"); add(btnCalculate); HandlerClass handler = new HandlerClass(); btnCalculate.addActionListener(handler); } // end of CarInsuranceCalc method
C:\Users\Admin\Desktop\projCarInsuranceCalc\src\pk gCarInsuranceCalc\CarInsuranceCalc.java:50: warning: [unchecked] unchecked call to JComboBox(E[]) as a member of the raw type JComboBox
cboGender = new JComboBox(Gender);
^
where E is a type-variable:
E extends Object declared in class JComboBox
C:\Users\Admin\Desktop\projCarInsuranceCalc\src\pk gCarInsuranceCalc\CarInsuranceCalc.java:81: warning: [unchecked] unchecked call to JComboBox(E[]) as a member of the raw type JComboBox
cboAge = new JComboBox(Age);
^
where E is a type-variable:
E extends Object declared in class JComboBox
C:\Users\Admin\Desktop\projCarInsuranceCalc\src\pk gCarInsuranceCalc\CarInsuranceCalc.java:112: warning: [unchecked] unchecked call to JComboBox(E[]) as a member of the raw type JComboBox
cboNoClaim = new JComboBox(NoClaim);
^
where E is a type-variable:
E extends Object declared in class JComboBox
3 warnings