It would be useful to simulate the forces generated by Electric / Magnetic fields, to allow virtual electric motors for example to be built.
However I'm not sure that users would want to build every motor from first principles. I think perhaps an electric motor should be a standard building brick without needing to simulate its internal workings.
Example of such a Program (written in C++ not Java) :
A software for 3D magnetostatics. It is optimized for all sort of accelerator magnets such as undulators, wigglers, dipole and quadrupole magnets. It uses a a finite volume integral approach. It handles current coils, non linear iron type material and anisotropic permanent magnet type materials of arbitrary shape. Radia computes very accurately the integrated field components (dipole, quadrupole,..)