Solar system rotating in java?

I’m quite new to Java and want to program an easy sun system where the moon rotates around the earth and the earth around the sun and sun rotates around its own axis, as shown in figure.If possible to design it in JFrame and JPanel.

enter image description here