(Source code introduction
This is a small program that simply rotates the earth. When you drag the button, the earth image rotates in the drag direction. If you click the image without dragging the button and then move it, the earth image will move with it. You can download to learn more. I hope it will help you.)