This is not a straightforward programming issue, and is likely to be closed soon.
Regardless, games are not programmed in JBox2D, and JBox2D in one program. If you are looking for help using the jbox2d library, a quick google search showed one tutorial (for android, but I would expect the general use of the library to be pretty general), which looks like it might be useful - try the JBox2D user manual.
On the other hand, if you really want to know how to program games in general ... well, this is a much more important topic, and it is best to solve it using Google to search for game lessons. Just remember that game development is a common topic, not platform specific, so don't shy away from tutorials not written for Java, try and adapt their sample code instead, and you can learn even more!
source share