private void nameCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameCmbxActionPerformed
        tableModel.setRowCount(0);
        String name = "";
        if (nameCmbx.getSelectedItem() != null && nameCmbx.getSelectedIndex() != 0) {
            name = nameCmbx.getSelectedItem().toString();
            try {
                Student student = controller.searchStudentByName(name);
                addTxt.setText(student.getAddress());
                phoneTxt.setText(student.getMobileNumber());
                genderTxt.setText(student.isMale() ? "Male" : "Female");
                gurdNameTxt.setText(student.getGuardianName());
                guardPhnTxt.setText(student.getGuardianNumber());
                guardPhnTxt.setText(student.getGuardianNumber());
                idCmbx.setSelectedItem(student.getStudentID());
                imgLbl.setIcon(student.getImage());
                ResultSet rst = controller.getClassDetailsByName(nameCmbx.getSelectedItem().toString());
                while (rst.next()) {
                    tableModel.addRow(new String[]{rst.getString(1), rst.getString(2), rst.getString(3), rst.getString(4)});
                }
            } catch (SQLException ex) {

            }
        }
    }//GEN-LAST:event_nameCmbxActionPerformed