The above simulation was created under the following assumption:
Only electric field exists between gap, there is no magnetic field between the gap.
And there is only uniform magnetic field in the two semicircular region.
The effect of the electric field between gap is to increase the energy of the charged particle (without changing direction).
And the effect of the magnetic field is to change direction of charged particle (without changing magnitude).
If you want to simulate magnetic field between the gap, you have to decide what kind of magnetic field in there.
You need to define your model before you can create an simulation.
The source code is available as attached file under the first message: cyclotron.java
Please download it by yourself. However, it was written many years ago with JDK1.0.2.