Optical trapping is an attractive and multidisciplinary topic that has become the center of attention to a large number of researchers. Moreover, it is a suitable subject for advanced students that requires a knowledge of a wide range of topics. As a result, it has been incorporated into some syllabuses of both undergraduate and graduate programs. In this paper, basic concepts in laser trapping theory are reviewed. To provide a better understanding of the underlying concepts for students, a Java application for simulating the behavior of a dielectric particle trapped in a highly focused beam has been developed. The program illustrates a wide range of theoretical results and features, such as the calculation of the force exerted by a beam in the Mie and Rayleigh regimes or the calibration of the trap stiffness. Some examples that are ready to be used in the classroom or in the computer lab are also supplied.