Electronic properties of single-walled carbon nanotubes under electric and magnetic fields