Yes, it is the wrong section, as you can see in the description of this section ("Processing Implementations"), it is for variants of Processing made with other languages (JavaScript, Ruby, etc.).
Moved to General Discussions as your question is very broad, it isn't not (not yet) a real programming question.
I suggest to google a bit to see if a simulation of magnetism exists for Java, how they did it, what are the relevant formulae (Wikipedia can be a good starting point, both for theory and for links), and so on.