Electron spin resonance in a two-dimensional electron gas induced by current or by electric field