private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
       if((jComboBox1.getSelectedIndex()!=0&&jRadioButton1.isSelected())||
               (jComboBox1.getSelectedIndex()!=0&&jRadioButton2.isSelected())||
               (jComboBox1.getSelectedIndex()!=0&&jRadioButton3.isSelected())||
               (jComboBox1.getSelectedIndex()!=0&&jRadioButton4.isSelected())
               )
       {

           Thread av = new Searchalgorithm();
        if (CurrentThread1 == null) {
            av.start();
        } else {
            JOptionPane.showMessageDialog(null, "Please wait   \nOne search is already running\n Please cancel the previous search");
        }

       }
       else
       {
           JOptionPane.showMessageDialog(null, "Before any search \nyou must select the location to search for \nand the type of" +
                   "search");
       }
        
}